链接:现在是晚上
#include <iostream>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include<stdio.h>
#include<math.h>
using namespace std;
int gcd(int a, int b)
{
if(b == 0) return a;
return gcd(b, a % b);
}
int main()
{
int t;
scanf("%d", &t);
while(t--)
{
int m, n;
scanf("%d%d", &m, &n);
if(gcd(m, n) == 1) puts("NO");
else puts("YES");
}
return 0;
}