//算法练习No.21
//寻找必胜态与必败态
#include <iostream>
using namespace std;

string solve()
{
    int n,m;
        cin >> n >> m;
        if(n % (m+1) == 0)
            return "NO";
        else
            return "YES";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin >> t;
    while(t--)
    {
        cout << solve() << endl;
    }

    return 0;
    
}
// 64 位输出请用 printf("%lld")