#include <bits/stdc++.h>
using namespace std;
void DenTofieM() {
  long long test;
  scanf("%lld", &test);
  while (test--) {
    long long row, cal;
    scanf("%lld %lld", &row, &cal);
    if (row == 1 || cal == 1)
      cout << "YES"
           << "\n";
    else if (row == 2 && cal == 2)
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
}
int main() {
  DenTofieM();
  return 0;
}
