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