#include using namespace std; int main() { int i,j,n,m,T; bool p; scanf("%d",&T); while (T--) { scanf("%d%d",&n,&m); p=0; for (i=0;i<=6;i++) for (j=0;j<=6;j++) if ((double)(i+j)/2-(double)(i*m+j*n)/(n*m)==1) { p=1; break; } if (p) printf("Yes\n"); else printf("No\n"); } }