Appu and Sugarcane Farm-1

0

0 votes
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.

Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?