#include<bits/stdc++.h>
using namespace std;
long long t,i=1;
bool ans[1000005]={1};
bool fun(int a,int b,int i){
i++;
if(a==b) return true;
else if(a>b) return false;
else return fun(a^i,b,i);
}
int main(){
cin>>t;
for(int i=1;i<=t;i++){
long long n,m;
cin>>n>>m;
ans[i]=fun(ans[i],n,i);
}
for(int i=1;i<=t;i++){
if(ans[i]==1) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}