#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl "\n"




bool powerOf2(ll x){
    return x && (!(x&(x-1)));
}

void solve(){
    
    ll u, v;
    
    cin>>u>>v;
    
    
    if(v<u || (powerOf2(u) && !powerOf2(v))){
        cout<<"No\n";
    }else{
        if(u==v || (powerOf2(v))){
            cout<<"Yes\n";
        }else{
            ll num = u;
            
          
            
            bool flag = false;

            
            while(num<v){
                ll maxN = -1;

                for(int i = 0;i<32; i++){
                    
                    ll msk = 1<<i;
                    
                    if(num + msk > v){
                        break;
                    }
                    
                    if(num & msk){
                        if(num + msk == v){
                            flag = true;
                            break;
                        }
                        maxN = max(maxN, msk);
                    }
                }
                
                
                if(flag || maxN == -1) break;
                
                num+=maxN;
            }
            
            
            if(flag || num==v){
                cout<<"Yes\n";
            }else{
                cout<<"No\n";
            }
            
        }
     
    }
    
    
    

    
}

int main(){
    int t;
    cin>>t;
    while(t--)
        solve();
    return 0;
}

