#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long mul = 1;
  while (b--) {
    mul = mul * a;
  }
  return mul;
}
int main() {
  ios::sync_with_stdio(false);
  long long tt, i, j;
  cin >> tt;
  while (tt--) {
    long long n, k;
    cin >> n >> k;
    if (n == 1 || k == 1 || (n == 2 && k == 2)) {
      cout << "YES\n";
    } else
      cout << "NO\n";
  }
  return 0;
}
