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