#include <bits/stdc++.h>
using namespace std;
long long int min(long long int a, long long int b) {
  if (a < b)
    return a;
  else
    return b;
}
long long int max(long long int a, long long int b) {
  if (a > b)
    return a;
  else
    return b;
}
int main() {
  long long int te;
  cin >> te;
  for (long long int t = 0; t < te; t++) {
    long long int n, m;
    cin >> n >> m;
    if (n == 1 || m == 1)
      cout << "YES" << endl;
    else if (m == 2 && n == 2)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
