Surely you have seen insane videos by South Korean rapper PSY, such as "Gangnam Style", "Gentleman" and "Daddy". You might also hear that PSY has been recording video "Oppa Funcan Style" two years ago (unfortunately we couldn't find it on the internet). We will remind you what this hit looked like (you can find original description [here](http://acm.timus.ru/problem.aspx?space=1&num=2107&locale=en)):
On the ground there are $n$ platforms, which are numbered with integers from $1$ to $n$, on $i$\-th platform there is a dancer with number $i$. Further, every second all the dancers standing on the platform with number $i$ jump to the platform with the number $f(i)$. The moving rule $f$ is selected in advance and is not changed throughout the clip.
The duration of the clip was $k$ seconds and the rule $f$ was chosen in such a way that after $k$ seconds all dancers were in their initial positions (i.e. the $i$\-th dancer stood on the platform with the number $i$). That allowed to loop the clip and collect even more likes.
PSY knows that enhanced versions of old artworks become more and more popular every day. So he decided to release a remastered-version of his video.
In his case "enhanced version" means even more insanity, so the number of platforms can be up to $10^{18}$! But the video director said that if some dancer stays on the same platform all the time, then the viewer will get bored and will turn off the video immediately. Therefore, for all $x$ from $1$ to $n$ $f(x) \neq x$ must hold.
Big part of classic video's success was in that looping, so in the remastered version all dancers should return to their initial positions in the end of the clip as well.
PSY hasn't decided on the exact number of platforms and video duration yet, so he asks you to check if there is a good rule $f$ for different options.
## Input
In the first line of input there is one integer $t$ ($1 \le t \le 10^{4}$) — the number of options for $n$ and $k$ to check.
In the next $t$ lines the options are given: each option is described with two integers $n$ and $k$ ($1 \le n \le 10^{18}$, $1 \le k \le 10^{15}$) — the number of dancers and the duration in seconds.
**It is guaranteed that the number of different values of $k$ in one test is not greater than $50$.**
## Output
Print $t$ lines. If the $i$\-th option of the video is feasible, print "_YES_" (without quotes) in $i$\-th line, otherwise print "_NO_" (without quotes).
[samples]
**Definitions**
Let $ t \in \mathbb{Z}^+ $ be the number of test cases.
For each test case, let $ n \in \mathbb{Z}^+ $ be the number of platforms (dancers), and $ k \in \mathbb{Z}^+ $ be the duration in seconds.
Let $ f: \{1, 2, \dots, n\} \to \{1, 2, \dots, n\} $ be a permutation (since dancers move bijectively between platforms).
**Constraints**
1. $ 1 \le t \le 10^4 $
2. $ 1 \le n \le 10^{18} $, $ 1 \le k \le 10^{15} $
3. $ f(x) \ne x $ for all $ x \in \{1, \dots, n\} $ (no fixed points)
4. $ f^k(x) = x $ for all $ x \in \{1, \dots, n\} $ (all dancers return to initial positions after $ k $ seconds)
**Objective**
For each test case $ (n, k) $, determine whether there exists a permutation $ f $ on $ n $ elements with:
- No fixed points: $ \forall x, f(x) \ne x $,
- $ f^k = \text{id} $ (the identity permutation).
That is, the permutation $ f $ has order dividing $ k $, and all its cycle lengths divide $ k $, but no cycle has length 1.
Thus, the problem reduces to:
> Does there exist a partition of $ n $ into positive integers $ \ell_1, \ell_2, \dots, \ell_m \ge 2 $ such that $ \sum_{i=1}^m \ell_i = n $ and $ \ell_i \mid k $ for all $ i $?
Equivalently:
> Can $ n $ be expressed as a sum of integers, each at least 2 and each dividing $ k $?
**Final Formal Statement**
For given $ n, k \in \mathbb{Z}^+ $, output "YES" if and only if:
$$
\exists \text{ a multiset } S \subseteq D_k \setminus \{1\} \text{ such that } \sum_{\ell \in S} \ell = n,
$$
where $ D_k = \{ d \in \mathbb{Z}^+ : d \mid k \} $ is the set of positive divisors of $ k $.
Equivalently, define $ m = \min(D_k \setminus \{1\}) $ if $ D_k \setminus \{1\} \ne \emptyset $, else $ m = \infty $.
Then the condition is:
- If $ k = 1 $: then $ D_k = \{1\} $, so $ D_k \setminus \{1\} = \emptyset $ → impossible unless $ n = 0 $, but $ n \ge 1 $ → **NO**.
- Else: let $ m = \min\{ d \mid d \mid k, d \ge 2 \} $. Then we can form any $ n \ge \text{some minimal value} $ using multiples of $ m $, but we must check if $ n $ is representable as a nonnegative integer combination of divisors of $ k $ that are $ \ge 2 $.
However, since we can use any number of any divisor $ \ge 2 $ of $ k $, and the set of allowed cycle lengths is $ D_k \setminus \{1\} $, the necessary and sufficient condition is:
- $ n \ge \min(D_k \setminus \{1\}) $, **and**
- $ n $ is representable as a sum of elements from $ D_k \setminus \{1\} $.
But since the set includes all divisors $ \ge 2 $ of $ k $, and we can use arbitrarily many copies, the problem reduces to the **Frobenius coin problem** with multiple denominations. However, since we have all divisors of $ k $ greater than 1, and the smallest such divisor is $ m $, then:
> **If $ m \le n $, and $ m \mid k $, $ m \ge 2 $, then since we can use $ m $ repeatedly, we can form all $ n \ge m $ that are congruent to some residue modulo $ m $** — but we are not restricted to one cycle length. We can use any divisor $ d \ge 2 $ of $ k $.
Actually, the key insight:
Let $ m = \min\{ d \in \mathbb{Z} : d \mid k, d \ge 2 \} $.
Then the set $ D_k \setminus \{1\} $ contains $ m $, and since $ m \mid k $, and $ m \ge 2 $, we can form any integer $ n \ge m $ as a sum of $ m $'s if $ n $ is a multiple of $ m $? No — we can use other divisors too.
But since $ m \mid d $ for all $ d \in D_k $ (because $ m $ is the smallest divisor $ \ge 2 $, and all divisors are multiples of the smallest prime factor), then **all elements of $ D_k \setminus \{1\} $ are multiples of $ m $**.
Therefore, any sum of them is a multiple of $ m $.
Thus:
- Necessary: $ m \mid n $
- Also: $ n \ge m $
But wait — is that sufficient?
Suppose $ m \mid n $ and $ n \ge m $. Then we can write $ n = q \cdot m $, with $ q \ge 1 $, and use $ q $ cycles of length $ m $. Since $ m \mid k $, each cycle of length $ m $ satisfies $ f^k(x) = x $. And $ m \ge 2 $, so no fixed points.
Thus, the condition is:
> Let $ m = \min\{ d \mid d \mid k, d \ge 2 \} $.
> Then the answer is "YES" if and only if $ m \le n $ and $ m \mid n $.
But what if $ k = 1 $? Then $ D_k = \{1\} $, so $ D_k \setminus \{1\} = \emptyset $, so no possible cycle lengths $ \ge 2 $ → "NO".
What if $ k \ge 2 $? Then $ m $ exists.
But what if $ n < m $? Then even the smallest allowed cycle is too big → "NO".
Thus:
**Final Answer Condition**
Let $ m = \begin{cases}
\min\{ d \in \mathbb{Z}^+ : d \mid k, d \ge 2 \} & \text{if } k \ge 2 \\
\infty & \text{if } k = 1
\end{cases} $
Then:
$$
\boxed{\text{YES} \iff k \ge 2 \text{ and } m \le n \text{ and } m \mid n}
$$
But note: $ m $ is the **smallest prime factor** of $ k $, because the smallest divisor $ \ge 2 $ of any integer $ k \ge 2 $ is its smallest prime factor.
So we can restate:
Let $ p = \text{smallest prime divisor of } k $.
Then:
- If $ k = 1 $: NO
- Else if $ n < p $: NO
- Else if $ p \nmid n $: NO
- Else: YES
But wait — is it sufficient to use only cycles of length $ p $? Yes, because $ p \mid k $, so $ f^k = \text{id} $, and $ p \ge 2 $, so no fixed points. And if $ p \mid n $, then $ n = p \cdot q $, and we can have $ q $ disjoint cycles of length $ p $.
So the condition is:
> "YES" if and only if $ k \ge 2 $ and the smallest prime factor of $ k $ divides $ n $.
**Final Formal Statement**
**Definitions**
Let $ t \in \mathbb{Z}^+ $ be the number of test cases.
For each test case, let $ n, k \in \mathbb{Z}^+ $.
Let $ p(k) = \min\{ d \in \mathbb{Z}^+ : d \mid k, d > 1 \} $ — the smallest prime factor of $ k $.
**Constraints**
1. $ 1 \le t \le 10^4 $
2. $ 1 \le n \le 10^{18} $, $ 1 \le k \le 10^{15} $
**Objective**
For each test case $ (n, k) $, output "YES" if and only if:
$$
k \ge 2 \quad \text{and} \quad p(k) \mid n
$$
Otherwise, output "NO".