#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
template <class T>
inline void read(T &res) {
  char c;
  T flag = 1;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flag = -1;
  res = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') res = res * 10 + c - '0';
  res *= flag;
}
int main() {
  int t;
  read(t);
  while (t--) {
    int a, b;
    read(a), read(b);
    if (a > b) swap(a, b);
    if (a == 1 || (a == 2 && b == 2))
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
