#include <bits/stdc++.h>
using namespace std;
int n, m, t;
void solve() {
  scanf("%d%d", &n, &m);
  if (min(n, m) == 1 || max(n, m) == 2) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
}
int main() {
  scanf("%d", &t);
  while (t--) solve();
  return 0;
}
