简单题~~~
#include <iostream>
using namespace std;
int gcd(int a,int b)
{
if(b==0)
return a;
else
return gcd(b,a%b);
}
int main()
{
int T;
int m,n;
cin>>T;
while(T--)
{
cin>>m>>n;
if(m==1)
{
cout<<"NO"<<endl;
continue;
}
if(gcd(n,m)==1)
{
cout<<"NO"<<endl;
}
else
{
cout<<"YES"<<endl;
}
}
return 0;
}