#include <bits/stdc++.h>
bool solve() {
  int a, b;
  std::cin >> a >> b;
  return (a == 1 || b == 1 || a == 2 && b == 2);
}
int main() {
  int t;
  std::cin >> t;
  while (t--) {
    std::cout << (solve() ? "YES" : "NO") << std::endl;
  }
}
