#include <bits/stdc++.h>
int main() {
  int t, n, m, i;
  scanf("%d", &t);
  for (i = 0; i < t; i++) {
    scanf("%d%d", &n, &m);
    if (n == 1 || m == 1 || (n == 2 && m == 2))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
