It is a few minutes before the most anticipated hockey game of the year - the Geese vs. the Kangaroos. However, Mike is excited about the game for a different reason, namely, the possibility of making a fortune from betting!
Mike can bet any non-negative amount of money that the Geese will win, including non-integer denominations. If he bets
Similarly, Mike can bet any non-negative amount of money that the Kangaroos will win, including non-integer denominations. If he bets
Being sneaky, Mike can even bet on both teams at once! Note that there are never any ties, so exactly one team out of the Geese and the Kangaroos will win.
Luckily for him, the bookkeepers this year aren't very bright, and so, it may be possible to always make a profit regardless of the outcome of the match. Can you help Mike make a fortune by determining whether he can guarantee that he will receive strictly more money as a reward than the money he bets?
You will have to determine this answer for
Constraints
Subtask 1 [30%]
It is guaranteed that if it is possible for Mike to always receive more money than he bets, he can do so by betting a whole number of dollars at most
Subtask 2 [70%]
No additional constraints.
Input Specification
The first line contains a single integer,
Each of the following
Output Specification
For each of the YES
if it is possible for Mike to guarantee that he will receive strictly more money than he bets, and NO
otherwise.
Sample Input
2
3 5 3 10
1 2 4 8
Sample Output
YES
NO
Explanation
For the first scenario, Mike can bet
For the second scenario, although Mike can guarantee that he will not lose any money, he is unable to guarantee that he will gain money.
Comments
Damn this is literally just a math question... and not a particularly simple one!