Which belief system significantly influenced both the Ottoman Empire and Mughal India during their reigns?