#include <bits/stdc++.h>
using namespace std;
long long ans;
long long maxPro;
long long power(long long x, long long y) {
  long long temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else
    return x * temp * temp;
}
long long arrToNum(long long* arr) {
  long long temp = 0;
  for (long long i = 0, multiplier = 1; i < 50; i++, multiplier *= 2)
    if (arr[i] == 1) temp += multiplier;
  return temp;
}
void numToArr(long long num, long long* arr) {
  long long curr = power(2, 49);
  long long pos = 49;
  while (num != 0) {
    if (curr > num)
      ;
    else {
      arr[pos] = 1;
      num -= curr;
    }
    pos--;
    curr = curr / 2;
  }
}
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long x, y;
    cin >> x >> y;
    if (x == 2 && y == 2) {
      cout << "YES\n";
      continue;
    }
    if (x == 1 || y == 1) {
      cout << "YES\n";
      continue;
    } else {
      cout << "NO\n";
      continue;
    }
  }
  return 0;
}
