#include <bits/stdc++.h>
using namespace std;
namespace std {}
int main() {
  long long t;
  cin >> t;
  for (long long one = 0; one < t; one++) {
    long long n, m;
    cin >> n >> m;
    bool ans = true;
    if (n > 1 && m > 1) {
      if (n != 2 || m != 2) {
        ans = false;
      }
    }
    if (ans) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
