#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, n, m;
  cin >> T;
  while (T--) {
    int n, m;
    cin >> n >> m;
    if (n > m) swap(n, m);
    if (n == 1 || (n == 2 && m == 2))
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
