#include <bits/stdc++.h>
using namespace std;
void solve(void);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(10);
  int t = 1;
  cin >> t;
  for (int i = 0; i < t; i++) solve();
  return 0;
}
void solve() {
  int n, m;
  cin >> n >> m;
  if (n == 1 || m == 1 || (n == 2 && m == 2))
    cout << "YES\n";
  else
    cout << "NO\n";
}
