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