#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  while (n--) {
    int a, b;
    cin >> a >> b;
    if (a == 1 || b == 1) {
      cout << "YES"
           << "\n";
    } else {
      if (a > 2 || b > 2) {
        cout << "NO"
             << "\n";
      } else {
        cout << "YES"
             << "\n";
      }
    }
  }
}
