# include <bits/stdc++.h>

const int N=100010,INF=0x3f3f3f3f;

int v[N],u[N];

int U,V;

inline int read(void){
	int res,f=1;
	char c;
	while((c=getchar())<'0'||c>'9')
		if(c=='-')f=-1;
	res=c-48;
	while((c=getchar())>='0'&&c<='9')
		res=res*10+c-48;
	return res*f;
}

int main(void){
	int T=read();
	while(T--){
		U=read(),V=read();
		if(U>V){
			puts("No");
			continue;
		}
		for(int i=0;i<=30;++i){
			u[i]=((U&(1<<i))>0)+u[i-1];
			v[i]=((V&(1<<i))>0)+v[i-1];
		}
		for(int i=30;i>=0;--i){
			if(u[i]<v[i]){
				puts("No");
				goto End;
			}
		}
		puts("Yes");
		End:;
	} 
	return 0;
}

