#include<bits/stdc++.h>
#define LL unsigned long long
#define BEG freopen("tstones.in","r",stdin);freopen("tstones.out","w",stdout);
#define END fclose(stdin);fclose(stdout);
using namespace std;
const LL N=100005,M=1000000;
LL n,t,s[N];
int main(){
BEG
int m;
cin>>m;
for(int ii=0;ii<m;ii++){
cin>>n>>t;
if(n%(t+1)!=0)
cout<<"NO"<<endl;
else
cout<<"YES"<<endl;
}
END
return 0;
}