#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &o, vector<T> v) {
  if (v.size() > 0) o << v[0];
  for (unsigned i = 1; i < v.size(); i++) o << " " << v[i];
  return o << endl;
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first - a.second) > (b.first - b.second);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, m;
    cin >> n >> m;
    if (n == 1 || m == 1)
      cout << "YES" << endl;
    else if (n == 2 && m == 2)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
