You are given a special jigsaw puzzle consisting of $n\cdot m$ identical pieces. Every piece has three tabs and one blank, as pictured below. $\{3$ 

The jigsaw puzzle is considered solved if the following conditions hold:  The pieces are arranged into a grid with $n$ rows and $m$ columns.  For any two pieces that share an edge in the grid, a tab of one piece fits perfectly into a blank of the other piece. 

Through rotation and translation of the pieces, determine if it is possible to solve the jigsaw puzzle.


-----Input-----

The test consists of multiple test cases. The first line contains a single integer $t$ ($1\le t\le 1000$) — the number of test cases. Next $t$ lines contain descriptions of test cases.

Each test case contains two integers $n$ and $m$ ($1 \le n,m \le 10^5$).


-----Output-----

For each test case output a single line containing "YES" if it is possible to solve the jigsaw puzzle, or "NO" otherwise. You can print each letter in any case (upper or lower).


-----Example-----
Input
3
1 3
100000 100000
2 2

Output
YES
NO
YES



-----Note-----

For the first test case, this is an example solution:  [Image] 

For the second test case, we can show that no solution exists.

For the third test case, this is an example solution: $\left\{\begin{array}{l}{3} \\{3} \end{array} \right\}$

Difficulty: interview

Starter code:

Solutions:
for _ in range(int(input())):
    n, m = list(map(int, input().split()))
    if n < m:
        n, m = m, n # n > m

    if m == 1:
        print("YES")
        continue

    if m == 2 and n == 2:
        print("YES")
        continue

    print("NO")


for zz in range(int(input())):
    n, m = list(map(int, input().split()))
    if n == 1 or m == 1 or (n <= 2 and m <= 2):
        print('YES')
    else:
        print('NO')


for i in range(int(input())):
    a, b = list(map(int,input().split()))
    if a > 2 and b >= 2 or b > 2 and a >= 2:
        print("NO")
    else:
        print("YES")


t=int(input())
for i in range(t):
  a,b=map(int,input().split())
  if a==2 and b==2:
    print('YES')
  elif a==1:
    print('YES')
  elif b==1:
    print('YES')
  else:
    print('NO')

for _ in range(int(input())):
	a, b = list(map(int, input().split()))
	if (a == 1 or b == 1) or (a == 2 and b == 2):
		print("YES")
	else:
		print("NO")


t=int(input())
for _ in range(t):
    n,m=list(map(int, input().split()))
    print('YES' if n == 1 or m == 1 or n == 2 and m == 2 else 'NO')


t = int(input())
for _ in range(t):
    n, m = list(map(int, input().split()))
    if n == 1 or m == 1 or (m == 2 and n == 2):
        print('YES')
    else:
        print('NO')


import sys
# from collections import deque

# print(help(deque))
# 26
input = lambda: sys.stdin.readline().strip()
ipnut = input
for i in range(int(input())):
    n,m = map(int,ipnut().split())
    if n==m==2 or min(n,m)==1:
        print("YES")
    else:
        print("NO")
    # n = int(input())
    # s = list(map(int,input()))
"""
10
10 11 12 13 14 15 16 17 11 11
"""

t = int(input())
for q in range(0, t):
    n, k = map(int, input().split())
    # a = list(map(int, input().split()))
    # n = int(input())
    # print(n)
    if n == k == 2:
        print("YES")
    elif n == 1 or k == 1:
        print("YES")
    else:
        print("NO")

import sys
ints = (int(x) for x in sys.stdin.read().split())
sys.setrecursionlimit(3000)

def main():
    ntc = next(ints)
    for tc in range(ntc):
        n, m = (next(ints) for i in range(2))
        print('YES' if n==1 or m==1 or n==m==2 else 'NO')
    return

main()


from sys import stdin,stdout                           #
import math                                            #
import heapq                                           #
                                                       #
t = 1                                                  #
def aint():                                            #
	return int(input().strip())                        #
def lint():                                            #
	return list(map(int,input().split()))              #
def fint():                                            #
	return list(map(int,stdin.readline().split()))     #
                                                       #	
########################################################

def main():
	n,m=lint()
	if n==1 or m==1:
		print("YES")
	elif n==2 and m==2:
		print("YES")
	else:
		print("NO")
	#solve

t=int(input())

########################################################
for i in range(t):                                     #
	#print("Case #"+str(i+1)+":",end=" ")		       #
	main()                                             #

t=int(input())
for i in range(t):
    n,m=map(int,input().split())
    if n == 1 or m==1:print("YES")
    elif n==2 and m==2:print("YES")
    else:print("NO")

for f in range(int(input())):
    n,m=map(int,input().split())
    if n==1 or m==1 or (n==2 and m==2):
        print("YES")
    else:
        print("NO")

for _ in range(int(input())):
    n, m = list(map(int, input().split()))
    print( "YES" if min(n, m) == 1 or max(n, m) <= 2 else "NO" )


t = int(input())
for i in range(t):
    n, m = map(int, input().split())
    if n != 1 and m != 1 and n*m != 4:
        print("NO")
    else:
        print("YES")

t = int(input())
for case in range(t):
    n, m = list(map(int, input().split()))
    if (min(n, m) == 1):
        print('YES')
    elif n == m and n == 2:
        print('YES')
    else:
        print('NO')

import sys

readline = sys.stdin.readline

ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: list(map(int, readline().split()))
nl = lambda: list(map(int, readline().split()))

def solve():
    n, m = nm()
    if min(n, m) == 1 or max(n, m) == 2:
        print('YES')
    else:
        print('NO')

# solve()

T = ni()
for _ in range(T):
    solve()


t = int(input())
for i in range(t):
    n, m = list(map(int, input().split()))
    if n == 1 or m == 1 or (n == 2 and m == 2):
        print("YES")
    else:
        print("NO")


import sys
T = int(sys.stdin.readline().strip())
def getT(line):
    return map(int, line.strip().split(" "))

for t in range(T):
    (m,n) = getT(sys.stdin.readline())
    if min(m, n) == 1: print("YES")
    elif min(m, n) == 2 and max(m, n) == 2: print("YES")
    else: print("NO")

for _ in range(int(input())):
    a,b=map(int,input().split())
    if min(a,b)==1:
        print('YES')
    elif a==2 and b==2:
        print('YES')
    else:
        print('NO')

#from sys import stdin, stdout, setrecursionlimit
#input = stdin.readline
#print = stdout.write
for _ in range(int(input())):
    n, m = list(map(int, input().split()))
    ans = 'NO'
    if n == 1 or m == 1 or (n == 2 and m == 2):
        ans = 'YES'
    print(ans)








for _ in range(int(input())):
    a, b = list(map(int, input().split()))
    if a == 1 or b == 1:
        print('YES')
    elif a == b == 2:
        print('YES')
    else:
        print('NO')


def solve():
    N,M = list(map(int,input().split()))
    if N==1 or M==1:
        print("YES")
    elif N==2 and M==2:
        print("YES")
    else:
        print("NO")

for _ in range(int(input())):
        solve()




def main():
    n, m = map(int, input().split())
    if n == 2 and m == 2:
        print("YES")
    else:
        if n == 1 or m == 1:
            print("YES")
        else:
            print("NO")



def __starting_point():
    t = int(input())
    for i in range(t):
        main()
__starting_point()

t = int(input())
for i10 in range(t):
    n, m = list(map(int, input().split()))
    if n == 1 or m == 1 or n + m == 4:
        print("YES")
    else:
        print("NO")


for _ in range(int(input())):
    n, m = list(map(int, input().split()))
    if n == 2 and m == 2:
        print("YES")
        continue
    if n == 1 or m == 1:
        print("YES")
        continue
    print("NO")




t = int(input())

for fk in range(t):
    n, m = [int(x) for x in input().split()]

    if n == 1 or m == 1:
        print('YES')

    elif n==2 and m == 2:
        print('YES')

    else : print('NO')

q = int(input())

for _ in range(q):
    n, m = list(map(int, input().split()))
    if n == 2 and m == 2 or n == 1 or m == 1:
        print("YES")
    else:
        print("NO")


q = int(input())
for i in range(q):
    n, m = list(map(int, input().split()))
    if (n == 1 or m == 1):
        print("YES")
    elif (n == m == 2):
        print("YES")
    else:
        print("NO")


n=int(input())
for i in range(n):
    a,b=[int(i) for i in input().split()]
    if (a==b==2) or a==1 or b==1:
        print('YES')
    else:
        print('NO')


t = int(input())
for u in range(t):
    n,m=list(map(int,input().split()))
    x = 2*n+2*m
    y = 3*n*m
    z = n*m
    if x+z >= y:
        print("YES")
    else:
        print("NO")


for _ in range(int(input())):
    n, m = tuple(map(int, input().split()))

    a = (n - 1) * m + (m - 1) * n
    b = n * m

    if a <= b:
        print('YES')
    else:
        print('NO')

t = int(input())

for case in range(t):
    n, m = map(int, input().split())
    ans = 'NO'
    if (n == m == 2):
        ans = 'YES'
    elif (n == 1 or m == 1):
        ans = 'YES'
    print (ans)

t = int(input())
for case in range(t):
    n, m = list(map(int, input().split()))
    perimeter = 2*n + 2*m

    inside = m*(n-1) + n*(m-1)
    nobs = 2*n*m

    if (nobs > perimeter):
        print ("NO")
    else:
        print ("YES")


for _ in range(int(input())):
    n, m = list(map(int, input().split()))
    if n * m <= n + m:
        print("YES")
    else:
        print("NO")


t = int(input())
for i in range(t):
    n, m = list(map(int, input().split()))
    if min(n, m) == 1 or m==2 and n==2:
        print("YES")
    else:
        print("NO")


# n = int(input())
# l = list(map(int, input().split()))
for tt in range(int(input())):
	n, m = map(int, input().split())
	if(n==1 or m==1 or (n==2 and m==2)):
		print("YES")
		continue
	print("NO")

for _ in range(int(input())):
    n, m = list(map(int, input().split()))
    if n == m and n == 2:
        print('YES')
    elif n >= 2 and m >= 2:
        print('NO')
    else:
        print('YES')


for _ in range(int(input())):
    n, m = map(int, input().split())
    print('YES' if n == 1 or m == 1 or (n == 2 and m == 2) else 'NO')

import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy

ORDA = 97       #a
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return [int(i) for i in input().split()]
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def revn(n): return str(n)[::-1]
def dd(): return collections.defaultdict(int)
def ddl(): return collections.defaultdict(list)
def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r
def divs(n, start=1):
    r = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if (n % i == 0):
            if (n / i == i):
                r.append(i)
            else:
                r.extend([i, n // i])
    return r
def divn(n, primes):
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t
def prime(n):
    if n == 2: return True
    if n % 2 == 0 or n <= 1: return False
    sqr = int(math.sqrt(n)) + 1
    for d in range(3, sqr, 2):
        if n % d == 0: return False
    return True
def convn(number, base):
    newnumber = 0
    while number > 0:
        newnumber += number % base
        number //= base
    return newnumber
def cdiv(n, k): return n // k + (n % k != 0)


for _ in range(ii()):
    n, m = mi()
    if n == 1 or m == 1 or m == 2 and n == 2:
        print('YES')
    else:
        print('NO')