#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  int t;
  long long int n, m;
  scanf("%d", &t);
  while (t--) {
    scanf("%lld%lld", &n, &m);
    if (n == 1 && m == 2) {
      printf("Yes\n");
    } else if (m == 1 && n == 2)
      printf("Yes\n");
    else if ((n % 2 == 0 || m % 2 == 0) && (n != 1 && m != 1))
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     122b <main+0x10b>
lea    0xea7(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
cmpq   $0x1,-0x10(%rbp)
jne    1192 <main+0x72>
cmpq   $0x2,-0x18(%rbp)
jne    1192 <main+0x72>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    1226 <main+0x106>
cmpq   $0x1,-0x18(%rbp)
jne    11b9 <main+0x99>
cmpq   $0x2,-0x10(%rbp)
jne    11b9 <main+0x99>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
jmp    1221 <main+0x101>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     11e9 <main+0xc9>
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1210 <main+0xf0>
cmpq   $0x1,-0x10(%rbp)
je     1210 <main+0xf0>
cmpq   $0x1,-0x18(%rbp)
je     1210 <main+0xf0>
lea    0xe06(%rip),%rdi
call   1030 <printf@plt>
jmp    121c <main+0xfc>
lea    0xdfa(%rip),%rdi
call   1030 <printf@plt>
jmp    1221 <main+0x101>
jmp    1226 <main+0x106>
jmp    1141 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0xc(%rsp)
jae    1157 <main+0x37>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xea5(%rip),%r14
lea    0x18(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xea0(%rip),%rbx
lea    0xe96(%rip),%r13
jmp    118c <main+0x6c>
mov    %r13,%rdi
nopl   0x0(%rax,%rax,1)
call   1030 <puts@plt>
subl   $0x1,0xc(%rsp)
jb     1147 <main+0x27>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x18(%rsp),%rcx
mov    0x10(%rsp),%rax
cmp    $0x1,%rcx
jne    11b5 <main+0x95>
mov    %rbx,%rdi
cmp    $0x2,%rax
je     1180 <main+0x60>
cmp    $0x1,%rax
jne    11c4 <main+0xa4>
mov    %rbx,%rdi
cmp    $0x2,%rcx
je     1180 <main+0x60>
test   $0x1,%cl
je     11cd <main+0xad>
test   $0x1,%al
jne    1178 <main+0x58>
cmp    $0x1,%rcx
je     1178 <main+0x58>
mov    %rbx,%rdi
cmp    $0x1,%rax
jne    1180 <main+0x60>
jmp    1178 <main+0x58>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%lld%lld\00"
@.str.2 = [5 x i8] c"Yes\0A\00"
@.str.3 = [4 x i8] c"No\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %47, %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %48
10: ; preds = %6
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64* %3, i64* %4)
%12 = load i64, i64* %3
%13 = icmp eq i64 %12, 1
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load i64, i64* %4
%16 = icmp eq i64 %15, 2
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %47
19: ; preds = %14, %10
%20 = load i64, i64* %4
%21 = icmp eq i64 %20, 1
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i64, i64* %3
%24 = icmp eq i64 %23, 2
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %46
27: ; preds = %22, %19
%28 = load i64, i64* %3
%29 = srem i64 %28, 2
%30 = icmp eq i64 %29, 0
br i1 %30, label %35, label %31
31: ; preds = %27
%32 = load i64, i64* %4
%33 = srem i64 %32, 2
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %43
35: ; preds = %31, %27
%36 = load i64, i64* %3
%37 = icmp ne i64 %36, 1
br i1 %37, label %38, label %43
38: ; preds = %35
%39 = load i64, i64* %4
%40 = icmp ne i64 %39, 1
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %45
43: ; preds = %38, %35, %31
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %45
45: ; preds = %43, %41
br label %46
46: ; preds = %45, %25
br label %47
47: ; preds = %46, %17
br label %6
48: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%lld%lld\00"
@str = [3 x i8] c"No\00"
@str.6 = [4 x i8] c"Yes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i32* %1 to i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp eq i32 %8, 0
br i1 %10, label %39, label %11
11: ; preds = %0, %33
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64* %2, i64* %3)
%13 = load i64, i64* %2
%14 = icmp eq i64 %13, 1
%15 = load i64, i64* %3
%16 = icmp eq i64 %15, 2
%17 = select i1 %14, i1 %16, i1 false
br i1 %17, label %33, label %18
18: ; preds = %11
%19 = icmp eq i64 %15, 1
%20 = icmp eq i64 %13, 2
%21 = select i1 %19, i1 %20, i1 false
br i1 %21, label %33, label %22
22: ; preds = %18
%23 = and i64 %13, 1
%24 = icmp eq i64 %23, 0
br i1 %24, label %30, label %25
25: ; preds = %22
%26 = and i64 %15, 1
%27 = icmp ne i64 %26, 0
%28 = select i1 %27, i1 true, i1 %14
%29 = select i1 %28, i1 true, i1 %19
br i1 %29, label %32, label %33
30: ; preds = %22
%31 = select i1 %14, i1 true, i1 %19
br i1 %31, label %32, label %33
32: ; preds = %30, %25
br label %33
33: ; preds = %25, %30, %18, %11, %32
%34 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %32 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0), %18 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0), %30 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0), %25 ]
%35 = call i32 @puts(i8* dereferenceable(1) %34)
%36 = load i32, i32* %1
%37 = add nsw i32 %36, -1
store i32 %37, i32* %1
%38 = icmp eq i32 %36, 0
br i1 %38, label %39, label %11
39: ; preds = %33, %0
ret i32 0
}