#include <bits/stdc++.h>
using namespace std;
long long maxfun(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long minfun(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
void solve() {
  int n, m;
  cin >> n >> m;
  if (n == 1 || m == 1) {
    cout << "YES";
    return;
  }
  if (n == 2 && m == 2) {
    cout << "YES";
    return;
  }
  cout << "NO";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
    cout << '\n';
  }
}
