#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    if (n > 2 && m > 2 || n == 2 && m > 2 || m == 2 && n > 2) {
      cout << "NO\n";
    } else {
      cout << "YES\n";
    }
  }
}
