#include <bits/stdc++.h>
using namespace std;
const int GO_MAX = 26;
const int ESP = 1e-9;
const int MAX = 101001;
const int INF = 1e9;
const int H_val = 37;
const int mod = 1000000;
int n, m, k, d, q, t, cs = 1;
int arr[MAX * 3];
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d %d", &n, &m);
    int mx = max(n, m);
    int mn = min(n, m);
    n = mn;
    m = mx;
    if (n == 1) {
      printf("YES\n");
    } else if (n == 2 && m == 2) {
      printf("YES\n");
    } else
      printf("NO\n");
  }
  return 0;
}
