jrMz and angles

Time Limit: 1000ms
Memory Limit: 65536KB
This problem will be judged on HDU. Original ID: 5660
64-bit integer IO format: %I64d      Java class name: Main

Description

jrMz has two types of angles, one type of angle is an interior angle of $n$-sided regular polygon, and the other type of angle is an interior angle of $m$-sided regular polygon. jrMz wants to use them to make up an angle of 360 degrees, which means, jrMz needs to choose some or none of the angles which belong to the first type and some or none of the angles which belong to the second type so that the sum value of the angles chosen equals 360 degrees. But jrMz doesn’t know whether it is possible, can you help him?

Input

The first line contains an integer $T\left(1\leq T\leq10\right)$——The number of the test cases.
For each test case, the only line contains two integers $n,m\left(1\leq n,m\leq100\right)$ with a white space separated.

Output

For each test case, the only line contains a integer that is the answer.

Sample Input

3
4 8
3 10
5 8

Sample Output

Yes
Yes
No

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .