#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mid (l+r)/2
#define left 2*i+1
#define righ 2*i+2s
#define IOS iostream::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;
const ll inf=1e9+100;
const ll maxn=2e5+100;
vector<int>a[2];
void solve(){
    ll n,u,v;
    a[0].clear();
    a[1].clear();
    cin>>u>>v;
    for(int i=0;i<30;i++){
        if(((1<<i)&u)!=0)a[0].pb(i);
        if(((1<<i)&v)!=0)a[1].pb(i);
    }
    bool b=0;
    if(a[1].size()>a[0].size()){
        cout<<"no"<<endl;
        return;
    }

    while(a[1].size()&&a[0].size()){
        if(a[1].back()>a[0].back()){
            b=1;
            a[1].pop_back();
            a[0].pop_back();
        }
        else if(a[1].back()==a[0].back()){
            //b=0;
            a[1].pop_back();
            a[0].pop_back();
        }
        else{
            if(b)a[0].pop_back();
            else {
                cout<<"no"<<endl;
                return;
            }
        }
    }
    if(a[1].empty()&&a[0].empty()){
        cout<<"yes"<<endl;
        return;
    }
    if(a[1].empty()){
        if(b)cout<<"yes"<<endl;
        else cout<<"no"<<endl;
        return;
    }
    cout<<"no"<<endl;
    return;
}

int32_t main()
{
    IOS

    ll t=1;
    cin>>t;

    while(t--){
        solve();
    }
    return 0;
}
/*
*/

