#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
long long modPow(long long a, long long b) {
  long long res = 1;
  a %= 998244353;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 998244353;
    a = a * a % 998244353;
  }
  return res;
}
long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
void solve() {
  int n, m;
  cin >> n >> m;
  if (n == 1 || m == 1 || (n == 2 && m == 2))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int testCases = 1;
  cin >> testCases;
  while (testCases--) {
    solve();
  }
  return 0;
}
