#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;
using graph = vector<vi>;
void go() {
  int n, m;
  cin >> n >> m;
  if (n > m) swap(n, m);
  if (n == 1 || (n == 2 && m == 2))
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) go();
  return 0;
}
