#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  bool res = n == 1 || m == 1 || (n == 2 && m == 2);
  cout << (res ? "YES" : "NO") << "\n";
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
