#include <bits/stdc++.h>
using namespace std;
int main() {
  int te;
  cin >> te;
  for (int kkk = 0; kkk < te; kkk++) {
    int n, m;
    cin >> n >> m;
    if (n <= 2 && m <= 2)
      cout << "YES\n";
    else if (n == 1)
      cout << "YES\n";
    else if (m == 1)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
