#include <bits/stdc++.h>
using namespace std;
int ini() {
  int x;
  scanf("%d", &x);
  return x;
}
long long inl() {
  long long x;
  scanf("%lld", &x);
  return x;
}
int main() {
  int t = ini();
  while (t--) {
    int n = ini(), m = ini();
    if (n == 2 && m == 2)
      cout << "YES\n";
    else {
      if (n > 1 && m > 1)
        cout << "NO\n";
      else
        cout << "YES\n";
    }
  }
  return 0;
}
