#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    long long d = n * m;
    long long a = (n - 1) * m;
    long long b = (m - 1) * n;
    long long h = a + b;
    if (h <= d) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
