#include <bits/stdc++.h>
using namespace std;
int compares(const void *a, const void *b) {
  return (*(long long *)a - *(long long *)b);
}
int comparen(const void *a, const void *b) {
  return (*(long long *)b - *(long long *)a);
}
void sorts(long long *array, long long length) {
  qsort(array, length, sizeof(long long), compares);
}
void sortn(long long *array, long long length) {
  qsort(array, length, sizeof(long long), comparen);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    bool c = false;
    if (n == 1 || m == 1) c = true;
    if (n == 2 && m == 2) c = true;
    if (c)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
  return 0;
}
