The new season of UESTC programming contest is coming, before the contest, the lottery area in the BBS of stuhome give out a new lottery to forecast this year's most clever student in the UESTC!
As the odds is given, love8909 is 1:2,and stephydx is 1:3, which is to say if you buy one coin for love8909 and he win the contest, you will get two coins back, so that you will have earned one coin in this lottery!
lxhgww feels it is quite interesting, so now he comes to the stuhome BBS to buy the lottery, no one want to lose money, so dose him. Now, lxhgww wants to know whether there is a strategy to buy the lottery that he can always earn no matter who would be the winner of the contest!
The first line of the input contains one integer T
, which indicates the number of test cases. For each test case, in the first line an integer N
meaning there are N
people join the contest (N
), then N
lines are given, each line contains two integers A
, the numbers in i
-th line is indicating the i
-th odds of contestants is A
Output "Yes" if lxhgww have a way to buy the lottery so that he can always win. Otherwise, output "No".
If lxhgww buy 5 coins for the first person, and 4 coins for the second, so that he totally used 9 coins, and if the first person wins, he can get 10 coins back, if the second person wins, he can get 12 coins back. So that lxhgww can always win in this way.