text: # Problem As you know Appu created aversion to Maths after that maths problem given by his teacher.So he stopped studying and began to do farming.He has some land where he starts growing sugarcane.At the end of the season he grew N sugarcanes.Is Appu satisfied??.No, He wants all his sugar canes to be of the same height.He goes to the nearby market .He finds a powder which when applied to one of his sugarcanes will double the height of that sugar cane.Now he needs to find out whether is it possible to make all the sugarcanes of the same height .Oh No!!Again maths.Please help him to find whether is it possible make all the sugar cane of the same height?Input First line contains N - the number of sugarcanes.Next N lines contains heights of sugarcanes seperated by space Output Print "YES" if it is possible make all the sugar cane of the same height or "NO" otherwise (quotes only for clarity) Constraints 1 ≤ N ≤ 50 Initial Height of all sugarcanes will be between 1 and 1,000,000,000, inclusive.SAMPLE INPUT 2 1 23 SAMPLE OUTPUT NO # Solution ''' # Read input from stdin and provide input before running code name = raw_input('What is your name?\n') print 'Hi, %s.' % name ''' num_of_sugarcanes = int(raw_input()) list_of_sugarcanes = map(int,raw_input().split()) max_of_sugarcanes = max(list_of_sugarcanes) def xyz (list_of_sugarcanes, max_sugar): for x in list_of_sugarcanes: z = x while z < max_sugar: z *= 2 if z > max_sugar: return "NO" return "YES" print (xyz(list_of_sugarcanes, max_of_sugarcanes))