#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long res = 1;
  while (b != 0) {
    if (b & 1) {
      res *= a;
    }
    a = (a * a);
    b = (b / 2);
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j, k, l, n, m, t;
  t = 1;
  cin >> t;
  while (t--) {
    cin >> n >> m;
    if (n == 1 || m == 1 || (n == 2 && m == 2)) {
      cout << "YES\n";
    } else
      cout << "NO\n";
  }
  return 0;
}
