#include <bits/stdc++.h>
using namespace std;
using pi = pair<long long, long long>;
using vi = vector<long long>;
using vb = vector<bool>;
using vpi = vector<pi>;
using vvi = vector<vi>;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const long long xd[4] = {1, 0, -1, 0}, yd[4] = {0, 1, 0, -1};
void solve() {
  long long n, m;
  cin >> n >> m;
  if (n == 1 || m == 1 || (n == 2 && m == 2)) {
    cout << "YES\n";
    return;
  }
  cout << "NO\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
