//数论,判断两数是否互质
#include <cstdio>
#include <iostream>
using namespace std;
int gcd(int a, int b) {
return b ? gcd(b, a%b) : a;
}
int main() {
int t;
scanf ("%d", &t);
while (t--) {
int n, m;
scanf ("%d%d", &m, &n);
if (gcd(n, m) == 1) printf ("NO\n");
else printf ("YES\n");
}
return 0;
}
编辑器加载中...