#include <bits/stdc++.h>
using namespace std;

int T, u, v;

int main() {
  for (scanf("%d", &T); T; T--) {
    scanf("%d%d", &u, &v);
    if (u > v) {
      puts("NO");
      continue;
    }
    bool flag = true;
    int s1 = 0, s2 = 0;
    for (int i = 0; i <= 30; i++) {
      s1 += (u >> i) & 1;
      s2 += (v >> i) & 1;
      flag &= (s1 >= s2);
    }
    puts(flag ? "YES" : "NO");
  }
  return 0;
}