#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
int n, m;
void solve() {
  cin >> n >> m;
  if (n > m) swap(n, m);
  if (n >= 3) {
    cout << "NO\n";
    return;
  }
  if (n == 1) {
    cout << "YES\n";
    return;
  }
  if (m >= 3) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
  }
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int i = 1; i <= t; ++i) {
    solve();
  }
  return 0;
}
