#include <bits/stdc++.h>
using namespace std;
struct unit {
  long long int a[1000000];
};
long long fact(long long int x) {
  if (x == 1 || x == 0)
    return 1;
  else
    return x * fact(x - 1);
}
long long power(long long int x, long long int n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return power(x * x, n / 2);
  else
    return x * power(x * x, (n - 1) / 2);
}
bool cmp(const pair<long long int, long long int>& a,
         const pair<long long int, long long int>& b) {
  if (a.second <= b.second) {
    if (a.second == b.second)
      return a.first < b.first;
    else
      return a.second < b.second;
  } else
    return a.second < b.second;
}
int main() {
  cin.tie(0), cin.sync_with_stdio(0), cout.tie(0), cout.sync_with_stdio(0);
  long long t;
  cin >> t;
  while (t--) {
    long long i, j, k, l, m, n;
    cin >> n >> m;
    if (n <= 2 && m <= 2)
      cout << "YES"
           << "\n";
    else if (n >= 1 && m == 1)
      cout << "YES"
           << "\n";
    else if (n == 1 && m >= 1)
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
}
