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