#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define debug(x) cerr << "[(" << __LINE__ << ") " << #x << "]: " << (x) << endl;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int q;
    cin >> q;
    while (q--) {
        ll x, y;
        cin >> x >> y;

        int ptr = 40;
        while (x < y && ptr >= 0) {
            int ptr2 = ptr;
            while ((1LL << ptr2) & x) {
                if (x + (1LL << ptr2) <= y) {
                    x += (1LL << ptr2);
                    ptr2++;
                } else {
                    break;
                }
            }
            ptr--;
        }

        cout << (x == y ? "YES" : "NO") << '\n';
    }
}
