#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  if (n == 1 || m == 1) {
    cout << "YES" << endl;
    return;
  }
  if (n == 2 && m == 2) {
    cout << "YES" << endl;
    return;
  }
  cout << "NO" << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
}
