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