#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    if (n <= 2 && m <= 2) {
      cout << "YES\n";
    } else if (n == 1 || m <= 1)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
