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