#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define quick ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const int inf = 0x3f3f3f3f, maxn = 2e5 + 5, mod = 998252334;
inline int read() {
int s = 0, w = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-')w = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9')s = s * 10 + ch - '0', ch = getchar();
return s * w;
}
void solve() {
int n, m;
n = read();
m = read();
if (n%(m+1)==0) cout << "NO" << endl;
else cout << "YES" << endl;
}
signed main() {
int t = 1;
cin >> t;
while (t--) {
solve();
}
return 0;
}