#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n, m;
    cin >> n >> m;
    if (n == 1 || m == 1)
      cout << "YES" << '\n';
    else {
      if (n > 2 || m > 2)
        cout << "NO" << '\n';
      else
        cout << "YES" << '\n';
    }
  }
}
