Assume the cricket ground to be an infinite grid and there can be more than 11 players in a team. It is known that the batsmen stand at the point (0,0). The field placement follows the following pattern
1st fielder is to be placed at 1 step to the east of batsman.
2nd fielder is to be placed at 2 steps to the north of 1st fielder
3rd fielder is to be placed at 3 steps to the West of 2nd fielder
4th fielder is to be placed at 4 steps to the south of 3rd fielder
5th fielder is to be placed at 5 steps to the East of 4th fielder
6th fielder is to be placed at 6 steps to the North of 5th fielder
And so on….
The fielders can be placed at only these positions and no where else…i.e at (1,0) , (1,2) , ( -2,2) , (-2,-2) and so on.
In the CWC final 2015, Michael Clarke realizes that to win the match, it is crucial to get Brendon McCullum out early . After a deep study, it was found that Brendon often gets out by giving catch to fielders standing at prime numbered positive positions of x on X-Y plane on the grid . He has decided that he will himself take the catch. Now, Clarke is confused and wants your help to win the match. Find out for him whether Clarke has positioned himself at any of the catching positions or not.
Input :
Input starts with T denoting the number of test cases.
Next T lines contains space separated coordinates x,y which are coordinates of point where Clarke has positioned himself.
Output :
If the position is wicket taking , then print “YES” without quotes else Print “NO”.
Constraints :
1 ≤ T ≤ 100
1 ≤ x,y ≤ 105
Problem Setter : Adesh Kala