P13711 [CodeChef] chapd
NOI
题目描述

You are given two positive integers – A and B. You have to check whether A is divisible by all the prime divisors of B.

Input
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
For each test case, you are given two space separated integers – A and B.

Output
For each test case, output "Yes" (without quotes) if A contains all prime divisors of B, otherwise print "No".

Constraints

1 ≤ T ≤ 10^4
1 ≤ A, B ≤ 10^18

Example
Input:
3
120 75
128 16
7 8

Output:
Yes
Yes
No

Explanation
Example case 1. In the first case 120 = 2^335 and 75 = 3*5^2. 120 is divisible by both 3 and 5. Hence, we will print "Yes"
Example case 2. In the second case both 128 and 16 are powers of two. Hence, the answer is "Yes"
Example case 3. In the third case 8 is power of two and 7 is not divisible by 2. So, the answer is "No"

输入格式

见题面

输出格式

见题面

样例输入
3 120 75 128 16 7 8
样例输出
Yes Yes No