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