#include <bits/stdc++.h>
using namespace std;
enum color { BLACK, WHITE, GRAY };
signed main() {
  long long i, j, k;
  long long T;
  cin >> T;
  while (T--) {
    long long s;
    long long N, M;
    cin >> N >> M;
    if (min(N, M) == 1)
      printf("YES\n");
    else if (M == 2 && N == 2)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
