#include <iostream>
#include <queue>
#include <cstdio>
#define ul unsigned long long
using namespace std;
inline ul in(){
ul x=0,c=getchar();
while(c<'0'||c>'9') c=getchar();
for(;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+(c^48);
return x;
}
int main(){
freopen("tstones.in","r",stdin);
freopen("tstones.out","w",stdout);
int t;
t=in();
while(t--){
ul a=in(),b=in();
if(a%(b+1)==0)
cout<<"YES";
else
cout<<"NO";
cout<<endl;
}
}