#include #include #include #include #include using namespace std; const double eps = 1e-8; int main(){ int t,n,m; scanf("%d",&t); while(t--){ scanf("%d%d",&n,&m); int ang1 = (n-2)*m,ang2 = (m-2)*n; int flag = 0; int i = 0; while(2*n*m-ang1*i >= 0){ int tmp = 2*n*m-ang1*i; if(tmp == 0){ flag = 1; break; } if(tmp-tmp/ang2*ang2 == 0){ flag = 1; break; } i++; } if(flag){ printf("Yes\n"); } else printf("No\n"); } return 0; }