#include <bits/stdc++.h>
using namespace std;
bool powertwo(long long v) {
  if (v && !(v & (v - 1))) return 1;
  return 0;
}
signed main() {
  long long n, m, t;
  cin >> t;
  while (t > 0) {
    cin >> n >> m;
    if (m > n) swap(m, n);
    if (m >= 2 && n > 2)
      cout << "NO" << '\n';
    else
      cout << "YES" << '\n';
    t--;
  }
  return 0;
}
