#include <bits/stdc++.h>
using namespace std;
int a[1000000];
int n, m;
int main() {
  int tt;
  cin >> tt;
  long long ans;
  while (tt--) {
    ans = 0;
    cin >> n >> m;
    if (n == 1 || m == 1)
      ans = 1;
    else if (n == 2 && m == 2)
      ans = 1;
    if (ans)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
