#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n >> m;
  if (n == 1 || m == 1 || (n == 2 && m == 2)) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long t;
  t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
