#include<bits/stdc++.h>
using namespace std;


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int T,n,m;
	cin>>T;
	while(T--){
		cin>>n>>m; 
		if(n%(m+1)==0){
			cout<<"NO"<<endl;
		}else{
			cout<<"YES"<<endl;
		}
	}
	

    return 0;
}