#include <bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
inline void boost() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int gcd(int a, int b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
const long long maxn = 2e5 + 123;
const long long inf = 1e9 + 123;
const long long linf = 1e18 + 123;
const long long mod = (1ll << 61) - 1;
const double eps = 1e-9;
const double pi = acos(-1);
int dx[8] = {0, 1, -1, 0, 1, -1, 1, -1};
int dy[8] = {1, 0, 0, -1, 1, 1, -1, -1};
int main() {
  boost();
  int T;
  cin >> T;
  while (T--) {
    int n, m;
    cin >> n >> m;
    if (n > m) {
      swap(n, m);
    }
    if (n > 2) {
      cout << "NO\n";
    } else if (n == 2 && m > 2) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
    }
  }
  exit(0);
}
