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