#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    solve();
    cout << "\n";
  }
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}
long long ceils(long long x, long long y) { return x / y + ((x % y) != 0); }
long long mult(long long x, long long y, long long mod) {
  return (x * y) % mod;
}
long long bin_pow(long long x, long long p, long long mod) {
  if (p == 0) return 1;
  if (p & 1) return mult(bin_pow(x, p - 1, mod), x, mod);
  return bin_pow(mult(x, x, mod), p / 2, mod);
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
vector<bool> is_prime(1e6 + 1, true);
long long binomialCoeffSpaceEff(long long n, long long k) {
  long long C[k + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = min(i, k); j > 0; j--) C[j] = (C[j] + C[j - 1]) % MOD;
  }
  return C[k];
}
long long primeFactors(long long n) {
  vector<long long> ar;
  long long i = 2;
  while (n > 0) {
    if (i > n) break;
    if (n % i == 0) {
      ar.push_back(i);
      while (n > 0 and n % i == 0) n = n / i;
    }
    i++;
  }
  return ar.size();
}
vector<pair<long long, long long> > primeFactorsFreq(long long n) {
  vector<pair<long long, long long> > ar;
  long long i = 2;
  while (n > 0) {
    if (i > n) break;
    if (n % i == 0) {
      long long cnt = 0;
      while (n > 0 and n % i == 0) n = n / i, cnt++;
      ar.push_back(make_pair(i, cnt));
    }
    i++;
  }
  return ar;
}
void seive() {
  is_prime[0] = is_prime[1] = false;
  for (long long i = 2; i * i <= 1e6 + 1; i++) {
    if (is_prime[i]) {
      for (long long j = i * i; j <= 1e6 + 1; j += i) is_prime[j] = false;
    }
  }
}
bool isSorted(vector<long long> &ar) {
  long long n = ar.size();
  for (long long i = 0; i < n - 1; i++) {
    if (ar[i + 1] < ar[i]) return false;
  }
  return true;
}
long long fastPower(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % MOD;
    y = y >> 1;
    x = (x * x) % MOD;
  }
  return res;
}
long long kadanesAlgo(vector<long long> ar) {
  long long n = ar.size();
  long long currMax = 0;
  long long mx = INT_MIN;
  for (long long i = 0; i < n; i++) {
    currMax += ar[i];
    if (currMax <= ar[i]) {
      currMax = ar[i];
    }
    mx = max(currMax, mx);
  }
  return mx;
}
pair<long long, long long> kadanesAlgoIdx(vector<long long> ar) {
  long long n = ar.size();
  long long currMax = 0;
  long long mx = INT_MIN;
  long long a = 0, b;
  for (long long i = 0; i < n; i++) {
    currMax += ar[i];
    if (currMax <= ar[i]) {
      currMax = ar[i];
      a = i;
    }
    if (mx < currMax) {
      mx = currMax;
      b = i;
    }
  }
  return make_pair(a, b);
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long fac(long long n) {
  while (n % 4 == 0) {
    n /= 4;
  }
  for (long long i = 3; i <= sqrt(n); i += 2) {
    while (n % (i * i) == 0) {
      n /= (i * i);
    }
  }
  return n;
}
long long findLCS(string a, string b, long long m, long long n) {
  long long LCS[m + 1][n + 1];
  long long result = 0;
  for (long long i = 0; i <= m; i++) {
    for (long long j = 0; j <= n; j++) {
      if (i == 0 || j == 0)
        LCS[i][j] = 0;
      else if (a[i - 1] == b[j - 1]) {
        LCS[i][j] = LCS[i - 1][j - 1] + 1;
        result = max(result, LCS[i][j]);
      } else
        LCS[i][j] = 0;
    }
  }
  return result;
}
long long add(long long x, long long y) {
  x += y;
  if (x >= MOD) return x - MOD;
  return x;
}
long long sub(long long x, long long y) {
  x -= y;
  if (x < 0) return x + MOD;
  return x;
}
long long f(long long x) {
  long long d = 0;
  while (x > 0) {
    d += x % 10;
    x /= 10;
  }
  return d;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  if (n == 1 or m == 1)
    cout << "YES";
  else if (n * m == 4)
    cout << "YES";
  else
    cout << "NO";
}
