#include<iostream>
#include<cstdio>
using namespace std;
unsigned long long getnum(){
unsigned long long res=0;
char tmp=getchar();
while(tmp<'0'||tmp>'9') tmp=getchar();
while(tmp<='9'&&tmp>='0'){
res=res*10+tmp-'0';
tmp=getchar();
}
return res;
}
int main(){
freopen("tstones.in","r",stdin);
freopen("tstones.out","w",stdout);
int T;
scanf("%d",&T);
unsigned long long N,K;
while(T--){
N=getnum(),K=getnum();
if(!(N%(K+1))) cout<<"YES\n";
else cout<<"NO\n";
}
return 0;
}