Abhineet the Chess master of NIT Kurukshetra got bored of 8x8 chess board and invented the new variation of Chess, the one on an infinite chess board. There is only a white king and $N$ black knights. The white king has to avoid checkmate as long as it can.

A situation is given. Determine if white king is in checkmate or not. The white king is in checkmate if and only if it is in check and it is not able to move to any of its neighboring positions which is not in check.

------ Input: ------

The first line will contain $T$, number of test cases. Then the test cases follow. 
The first line of each test case contains a single integer $N$.
The next N line contains 2 space-separated integers $Xi$ and $Yi$ denoting the position of knights.
The next line contains 2 space-separated integers $A$ and $B$ denoting the position of king

------ Output: ------
Print a single line corresponding to each test case — “YES” (without quotes) – if the king is in checkmate and “NO” (without quotes) – if the king is not in checkmate.

------ Constraints  ------
$1 ≤ T ≤ 5$
$1 ≤ N ≤ 10^{5}$
$-10^{9} ≤ Xi, Yi, A, B ≤ 10^{9}$

----- Sample Input 1 ------ 
2
6
1 0
0 2
2 5
4 4
5 0
6 2
3 2
4
5 6
3 5
2 8
-8 -8
0 0
----- Sample Output 1 ------ 
YES
NO
----- explanation 1 ------ 
In the first test case, the king is in cannot move to any valid position
In second test case, the king can easily make a valid move.

Source: codechef | Difficulty: MEDIUM
Tags: Implementation


Solutions:
t = int(input())
for _ in range(t):
	n = int(input())
	knight_positions = []
	for i in range(n):
		(knight_pos_x, knight_pos_y) = map(int, input().split())
		knight_positions.append((knight_pos_x - 1, knight_pos_y + 2))
		knight_positions.append((knight_pos_x + 1, knight_pos_y + 2))
		knight_positions.append((knight_pos_x + 2, knight_pos_y + 1))
		knight_positions.append((knight_pos_x + 2, knight_pos_y - 1))
		knight_positions.append((knight_pos_x + 1, knight_pos_y - 2))
		knight_positions.append((knight_pos_x - 1, knight_pos_y - 2))
		knight_positions.append((knight_pos_x - 2, knight_pos_y - 1))
		knight_positions.append((knight_pos_x - 2, knight_pos_y + 1))
	knight_pos = set(knight_positions)
	king_pos = []
	(king_pos_x, king_pos_y) = map(int, input().split())
	king_pos.append((king_pos_x - 1, king_pos_y + 1))
	king_pos.append((king_pos_x, king_pos_y + 1))
	king_pos.append((king_pos_x + 1, king_pos_y + 1))
	king_pos.append((king_pos_x + 1, king_pos_y))
	king_pos.append((king_pos_x + 1, king_pos_y - 1))
	king_pos.append((king_pos_x, king_pos_y - 1))
	king_pos.append((king_pos_x - 1, king_pos_y - 1))
	king_pos.append((king_pos_x - 1, king_pos_y))
	king_pos.append((king_pos_x, king_pos_y))
	ans = 'YES'
	for j in king_pos:
		if j not in knight_pos:
			ans = 'NO'
			break
	print(ans)


for i in range(int(input())):
	n = int(input())
	knight = []
	for i in range(n):
		(x, y) = map(int, input().split())
		knight.append([x, y])
	(kingx, kingy) = map(int, input().split())
	posmov = [[kingx - 1, kingy + 1], [kingx - 1, kingy], [kingx - 1, kingy - 1], [kingx + 1, kingy + 1], [kingx + 1, kingy], [kingx + 1, kingy - 1], [kingx, kingy - 1], [kingx, kingy + 1], [kingx, kingy]]
	for k in knight:
		if len(posmov):
			if abs(k[0] - kingx) <= 3 and abs(k[1] - kingy) <= 3:
				try:
					posmov.remove([k[0] - 1, k[1] - 2])
				except:
					pass
				try:
					posmov.remove([k[0] + 1, k[1] - 2])
				except:
					pass
				try:
					posmov.remove([k[0] - 1, k[1] + 2])
				except:
					pass
				try:
					posmov.remove([k[0] + 1, k[1] + 2])
				except:
					pass
				try:
					posmov.remove([k[0] - 2, k[1] - 1])
				except:
					pass
				try:
					posmov.remove([k[0] - 2, k[1] + 1])
				except:
					pass
				try:
					posmov.remove([k[0] + 2, k[1] - 1])
				except:
					pass
				try:
					posmov.remove([k[0] + 2, k[1] + 1])
				except:
					pass
		else:
			break
	print('NO' if len(posmov) else 'YES')


t = int(input())
for i in range(t):
	n = int(input())
	(l_k, c) = ([], 0)
	for j in range(n):
		(x, y) = map(int, input().split())
		l_k.append([x, y])
	(a, b) = map(int, input().split())
	for x in range(n):
		if l_k[x][0] == a or l_k[x][1] == b or abs(l_k[x][0] - a) == abs(l_k[x][1] - b):
			c += 1
			break
	if c != 0:
		(l, n_c) = ([[a + 1, b], [a - 1, b], [a, b + 1], [a, b - 1], [a + 1, b + 1], [a - 1, b - 1], [a + 1, b - 1], [a - 1, b + 1]], 0)
		for y in range(8):
			for k in range(n):
				if l_k[k][0] == l[y][0] or l_k[k][1] == l[y][1] or abs(l_k[k][0] - l[y][0]) == abs(l_k[k][1] - l[y][1]):
					n_c += 1
		if n_c >= 8:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input(''))
for _ in range(t):
	n = int(input(''))
	knight = []
	for i in range(n):
		l = list(map(int, input().split()))
		knight.append(l)
	king = list(map(int, input().split()))
	kingpos = [king, [king[0] - 1, king[1] - 1], [king[0] + 1, king[1] + 1], [king[0] - 1, king[1] + 1], [king[0] + 1, king[1] - 1], [king[0] - 1, king[1]], [king[0], king[1] - 1], [king[0] + 1, king[1]], [king[0], king[1] + 1]]
	for k in knight:
		knightpos = [[k[0] + 2, k[1] + 1], [k[0] + 2, k[1] - 1], [k[0] + 1, k[1] + 2], [k[0] + 1, k[1] - 2], [k[0] - 2, k[1] + 1], [k[0] - 2, k[1] - 1], [k[0] - 1, k[1] + 2], [k[0] - 1, k[1] - 2]]
		for j in knightpos:
			if j in kingpos:
				kingpos.remove(j)
	if len(kingpos) == 0:
		print('YES')
	else:
		print('NO')


for _ in range(0, int(input())):
	h = int(input())
	z = []
	c = 0
	for i in range(0, h):
		(k, p) = map(int, input().split())
		z.append((k - 2, p + 1))
		z.append((k - 2, p - 1))
		z.append((k + 2, p + 1))
		z.append((k + 2, p - 1))
		z.append((k + 1, p - 2))
		z.append((k - 1, p - 2))
		z.append((k + 1, p + 2))
		z.append((k - 1, p + 2))
	(a, b) = map(int, input().split())
	l = [(a, b - 1), (a, b + 1), (a - 1, b), (a + 1, b), (a + 1, b - 1), (a + 1, b + 1), (a - 1, b + 1), (a - 1, b - 1), (a, b)]
	for i in l:
		if i in set(z):
			c = c + 1
	if c == 9:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	l = []
	g = 0
	r = []
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append(str(a + 1) + ' ' + str(b + 2))
		l.append(str(a - 1) + ' ' + str(b + 2))
		l.append(str(a - 2) + ' ' + str(b + 1))
		l.append(str(a - 2) + ' ' + str(b - 1))
		l.append(str(a + 2) + ' ' + str(b - 1))
		l.append(str(a + 2) + ' ' + str(b + 1))
		l.append(str(a - 1) + ' ' + str(b - 2))
		l.append(str(a + 1) + ' ' + str(b - 2))
	(x, y) = map(int, input().split())
	r.append(str(x) + ' ' + str(y))
	r.append(str(x + 1) + ' ' + str(y + 1))
	r.append(str(x + 1) + ' ' + str(y - 1))
	r.append(str(x + 1) + ' ' + str(y))
	r.append(str(x - 1) + ' ' + str(y))
	r.append(str(x) + ' ' + str(y - 1))
	r.append(str(x) + ' ' + str(y + 1))
	r.append(str(x - 1) + ' ' + str(y - 1))
	r.append(str(x - 1) + ' ' + str(y + 1))
	for i in r:
		if i in set(l):
			g += 1
	if g == 9:
		print('YES')
	else:
		print('NO')


def knight_moves(x, y):
	offsets = [(1, 2), (2, 1), (-1, 2), (-2, 1), (1, -2), (2, -1), (-1, -2), (-2, -1)]
	for (dx, dy) in offsets:
		nx = x + dx
		ny = y + dy
		attacked.add((nx, ny))
for _ in range(int(input())):
	n = int(input())
	attacked = set()
	for i in range(n):
		(x, y) = map(int, input().split())
		knight_moves(x, y)
	(a, b) = map(int, input().split())
	ans = 'YES'
	offsets = [(0, 0), (1, 0), (0, 1), (-1, 0), (0, -1), (1, 1), (-1, 1), (1, -1), (-1, -1)]
	for (da, db) in offsets:
		nx = a + da
		ny = b + db
		if (nx, ny) not in attacked:
			ans = 'NO'
			break
	print(ans)


for _ in range(int(input())):
	ze = int(input())
	notsafe = []
	knightmoves = [(2, 1), (1, 2), (-1, 2), (1, -2), (-1, -2), (-2, 1), (2, -1), (-2, -1)]
	for _ in range(ze):
		(r1, c1) = map(int, input().split(' '))
		for (x, y) in knightmoves:
			i = r1 + x
			j = c1 + y
			notsafe.append((i, j))
	(a, b) = map(int, input().split(' '))
	fl = 1
	kingmoves = [(0, 0), (1, 0), (0, 1), (-1, 0), (0, -1), (1, 1), (-1, 1), (1, -1), (-1, -1)]
	for (k, l) in kingmoves:
		s = a + k
		g = b + l
		if (s, g) in notsafe:
			fl = 0
	if fl == 0:
		print('YES')
	else:
		print('NO')


for tc in range(int(input())):
	n = int(input())
	k = set()
	poss = True
	for i in range(n):
		(x, y) = map(int, input().split())
		k.add(str(x - 2) + str(y + 1))
		k.add(str(x - 2) + str(y - 1))
		k.add(str(x + 2) + str(y + 1))
		k.add(str(x + 2) + str(y - 1))
		k.add(str(x + 1) + str(y + 2))
		k.add(str(x + 1) + str(y - 2))
		k.add(str(x - 1) + str(y + 2))
		k.add(str(x - 1) + str(y - 2))
	(x, y) = map(int, input().split())
	if str(x) + str(y) not in k:
		poss = False
	if str(x) + str(y - 1) not in k:
		poss = False
	if str(x) + str(y + 1) not in k:
		poss = False
	if str(x - 1) + str(y) not in k:
		poss = False
	if str(x - 1) + str(y + 1) not in k:
		poss = False
	if str(x - 1) + str(y - 1) not in k:
		poss = False
	if str(x + 1) + str(y) not in k:
		poss = False
	if str(x + 1) + str(y + 1) not in k:
		poss = False
	if str(x + 1) + str(y - 1) not in k:
		poss = False
	print('YES' if poss else 'NO')


for _ in range(int(input())):
	pos = []
	for i in range(int(input())):
		(a, b) = map(int, input().split())
		pos.append([a, b])
	(x, y) = map(int, input().split())
	l = [(x, y), (x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1), (x + 1, y + 1), (x - 1, y - 1), (x + 1, y - 1), (x - 1, y + 1)]
	l = set(l)
	for i in pos:
		if (i[0] + 1, i[1] + 2) in l:
			l.remove((i[0] + 1, i[1] + 2))
		if (i[0] + 1, i[1] - 2) in l:
			l.remove((i[0] + 1, i[1] - 2))
		if (i[0] - 1, i[1] + 2) in l:
			l.remove((i[0] - 1, i[1] + 2))
		if (i[0] - 1, i[1] - 2) in l:
			l.remove((i[0] - 1, i[1] - 2))
		if (i[0] + 2, i[1] + 1) in l:
			l.remove((i[0] + 2, i[1] + 1))
		if (i[0] + 2, i[1] - 1) in l:
			l.remove((i[0] + 2, i[1] - 1))
		if (i[0] - 2, i[1] + 1) in l:
			l.remove((i[0] - 2, i[1] + 1))
		if (i[0] - 2, i[1] - 1) in l:
			l.remove((i[0] - 2, i[1] - 1))
	if len(l):
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	chp = set()
	for pk in range(n):
		(m, n) = tuple(map(int, input().split()))
		chp.add((m + 2, n + 1))
		chp.add((m + 2, n - 1))
		chp.add((m - 2, n + 1))
		chp.add((m - 2, n - 1))
		chp.add((m + 1, n + 2))
		chp.add((m - 1, n + 2))
		chp.add((m + 1, n - 2))
		chp.add((m - 1, n - 2))
	(k, p) = tuple(map(int, input().split()))
	tbc = set()
	tbc.add((k, p))
	tbc.add((k + 1, p))
	tbc.add((k - 1, p))
	tbc.add((k, p + 1))
	tbc.add((k, p - 1))
	tbc.add((k + 1, p + 1))
	tbc.add((k + 1, p - 1))
	tbc.add((k - 1, p + 1))
	tbc.add((k - 1, p - 1))
	if tbc.issubset(chp):
		print('YES')
	else:
		print('NO')


t = int(input())

def altPos(pos):
	(x, y) = pos
	ar = [[x + 1, y + 2], [x - 1, y + 2], [x + 2, y + 1], [x + 2, y - 1], [x + 1, y - 2], [x - 1, y - 2], [x - 2, y + 1], [x - 2, y - 1]]
	return ar

def kPos(x, y):
	xpos = [[x - 1, y], [x - 1, y + 1], [x, y + 1], [x + 1, y + 1], [x + 1, y], [x + 1, y - 1], [x, y - 1], [x - 1, y - 1]]
	return xpos
for _ in range(t):
	n = int(input())
	pos = []
	for i in range(n):
		(x, y) = map(int, input().split())
		pos += altPos([x, y])
	(kx, ky) = map(int, input().split())
	kpos = kPos(kx, ky)
	cond = False
	for i in kpos:
		if i not in pos:
			cond = True
			break
	if not cond:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	invalid = []
	for i in range(n):
		(x, y) = map(int, input().split())
		invalid.append((x + 1, y - 2))
		invalid.append((x + 2, y + 1))
		invalid.append((x + 1, y + 2))
		invalid.append((x + 2, y - 1))
		invalid.append((x - 2, y + 1))
		invalid.append((x - 2, y - 1))
		invalid.append((x - 1, y - 2))
		invalid.append((x - 1, y + 2))
	(a, b) = map(int, input().split())
	valid = [(a, b)]
	valid.append((a + 1, b + 1))
	valid.append((a + 1, b))
	valid.append((a + 1, b - 1))
	valid.append((a, b - 1))
	valid.append((a - 1, b - 1))
	valid.append((a - 1, b))
	valid.append((a - 1, b + 1))
	valid.append((a, b + 1))
	flag = 0
	for i in valid:
		if i not in invalid:
			flag = 1
			break
	if flag == 0:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	list1 = []
	for z in range(n):
		(a, b) = map(int, input().split())
		list1.append((a - 2, b - 1))
		list1.append((a - 2, b + 1))
		list1.append((a - 1, b + 2))
		list1.append((a - 1, b - 2))
		list1.append((a + 1, b - 2))
		list1.append((a + 1, b + 2))
		list1.append((a + 2, b - 1))
		list1.append((a + 2, b + 1))
	(x, y) = map(int, input().split())
	ans = 'YES'
	for z1 in range(x - 1, x + 2):
		for z2 in range(y - 1, y + 2):
			if (z1, z2) not in list1:
				ans = 'NO'
	print(ans)


for _ in range(int(input())):
	xx = []
	for i in range(int(input())):
		(x, y) = map(int, input().split())
		xx.append([x + 1, y + 2])
		xx.append([x + 2, y + 1])
		xx.append([x + 2, y - 1])
		xx.append([x + 1, y - 2])
		xx.append([x - 1, y - 2])
		xx.append([x - 2, y - 1])
		xx.append([x - 2, y + 1])
		xx.append([x - 1, y + 2])
	(a, b) = map(int, input().split())
	f = True
	for i in [[a + 1, b], [a + 1, b + 1], [a, b + 1], [a - 1, y + 1], [a - 1, b], [a - 1, b - 1], [a, b - 1], [a + 1, b - 1]]:
		if i in xx:
			f = False
			break
	print('NO' if f else 'YES')


T = int(input())
l = [(1, 2), (2, 1), (-1, 2), (-2, 1), (-2, -1), (-1, -2), (1, -2), (2, -1)]
m = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]
while T:
	T -= 1
	n = int(input())
	d = {}
	for i in range(n):
		(x, y) = list(map(int, input().split()))
		for (a, b) in l:
			d[x + a, y + b] = 1
	(a, b) = list(map(int, input().split()))
	t = 0
	try:
		d[a, b] = d[a, b]
		t = 1
	except KeyError:
		print('NO')
	if t:
		for (x, y) in m:
			try:
				d[a + x, b + y] = d[a + x, b + y]
				print('YES')
				break
			except KeyError:
				pass
		else:
			print('NO')


cases = int(input())
for case in range(cases):
	knights = int(input())
	attacked_squares = []
	king_sqaures = []
	for line in range(knights):
		(x, y) = map(int, input().split())
		attacked_squares.extend([[x + 2, y - 1], [x + 2, y + 1], [x - 2, y - 1], [x - 2, y + 1], [x - 1, y - 2], [x + 1, y - 2], [x - 1, y + 2], [x + 1, y + 2]])
	(x, y) = map(int, input().split())
	king_sqaures.extend([[x + 1, y - 1], [x + 1, y], [x + 1, y + 1], [x, y - 1], [x, y + 1], [x - 1, y - 1], [x - 1, y], [x - 1, y + 1]])
	if [x, y] in attacked_squares:
		if all((position in attacked_squares for position in king_sqaures)):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


tc = int(input())
for _ in range(tc):
	n = int(input())
	pos_knights = []
	for i in range(n):
		pos = [int(x) for x in input().split()]
		pos_knights.append(pos)
	pos_king = [int(x) for x in input().split()]
	king_area = []
	for i in range(3):
		for j in range(3):
			king_area.append([pos_king[0] - 1 + i, pos_king[1] - 1 + j])
	for pos in pos_knights:
		if [pos[0] + 2, pos[1] + 1] in king_area:
			king_area.remove([pos[0] + 2, pos[1] + 1])
		if [pos[0] + 2, pos[1] - 1] in king_area:
			king_area.remove([pos[0] + 2, pos[1] - 1])
		if [pos[0] - 2, pos[1] + 1] in king_area:
			king_area.remove([pos[0] - 2, pos[1] + 1])
		if [pos[0] - 2, pos[1] - 1] in king_area:
			king_area.remove([pos[0] - 2, pos[1] - 1])
		if [pos[0] + 1, pos[1] + 2] in king_area:
			king_area.remove([pos[0] + 1, pos[1] + 2])
		if [pos[0] + 1, pos[1] - 2] in king_area:
			king_area.remove([pos[0] + 1, pos[1] - 2])
		if [pos[0] - 1, pos[1] + 2] in king_area:
			king_area.remove([pos[0] - 1, pos[1] + 2])
		if [pos[0] - 1, pos[1] - 2] in king_area:
			king_area.remove([pos[0] - 1, pos[1] - 2])
	if king_area == []:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	knights = []
	for _ in range(n):
		(a, b) = map(int, input().split())
		knights.append((a + 2, b + 1))
		knights.append((a + 2, b - 1))
		knights.append((a + 1, b + 2))
		knights.append((a + 1, b - 2))
		knights.append((a - 1, b + 2))
		knights.append((a - 1, b - 2))
		knights.append((a - 2, b + 1))
		knights.append((a - 2, b - 1))
	(a, b) = map(int, input().split())
	for i in [(a - 1, b - 1), (a - 1, b), (a - 1, b + 1), (a, b - 1), (a, b), (a, b + 1), (a + 1, b - 1), (a + 1, b), (a + 1, b + 1)]:
		for k in knights:
			if i == k:
				break
		else:
			continue
		print('YES')
		break
	else:
		print('NO')


def in_check(x, y, knight_coors):
	knight_attacks = [(x - 2, y - 1), (x - 2, y + 1), (x + 2, y - 1), (x + 2, y + 1), (x - 1, y - 2), (x - 1, y + 2), (x + 1, y - 2), (x + 1, y + 2)]
	for i in knight_attacks:
		if i in knight_coors:
			return True
	return False
t = int(input())
for _ in range(t):
	n = int(input())
	knight_coors = []
	for _ in range(n):
		knight_coors.append(tuple(map(int, input().split())))
	(a, b) = list(map(int, input().split()))
	squares = [(a, b), (a - 1, b), (a + 1, b), (a, b - 1), (a, b + 1), (a - 1, b - 1), (a + 1, b - 1), (a + 1, b + 1), (a - 1, b + 1)]
	in_checkmate = 'YES'
	for (x, y) in squares:
		if not in_check(x, y, knight_coors):
			in_checkmate = 'NO'
			break
	print(in_checkmate)


for i in range(int(input())):
	n = int(input())
	List = []
	for i in range(n):
		List.append([int(x) for x in input().split()])
	(X, Y) = map(int, input().split())
	Check = False
	for i in List:
		x = i[0]
		y = i[1]
		if abs(X - x) == 2 and abs(Y - y) == 1:
			Check = True
			break
		elif abs(X - x) == 1 and abs(Y - y) == 2:
			Check = True
			break
	if Check:
		print('YES')
	else:
		print('NO')


t = input()
for c in range(0, int(t)):
	n = int(input())
	li = []
	for i in range(n):
		(a, b) = map(int, input().split())
		li.append((a - 1, b - 2))
		li.append((a - 1, b + 2))
		li.append((a - 2, b - 1))
		li.append((a - 2, b + 1))
		li.append((a + 1, b - 2))
		li.append((a + 1, b + 2))
		li.append((a + 2, b - 1))
		li.append((a + 2, b + 1))
	ans = 'YES'
	(x, y) = map(int, input().split())
	for u in range(x - 1, x + 2):
		for v in range(y - 1, y + 2):
			if (u, v) not in li:
				ans = 'NO'
	print(ans)


from collections import defaultdict
get_int = lambda : int(input())
get_mint = lambda : list(map(int, input().split()))
for _ in range(get_int()):
	N = get_int()
	d = defaultdict(set)
	for _ in range(N):
		(xi, yi) = get_mint()
		d[xi].add(yi)
	(A, B) = get_mint()
	knight_moves = [(-2, 1), (-2, -1), (2, 1), (2, -1), (1, 2), (1, -2), (-1, 2), (-1, -2)]
	check = False
	for (ai, bi) in knight_moves:
		if A + ai in d and B + bi in d[A + ai]:
			check = True
			break
	if not check:
		print('NO')
		continue
	else:
		print('YES')
		continue
	king_moves = [(-1, 0), (1, 0), (0, 1), (0, -1), (-1, -1), (-1, 1), (1, 1), (1, -1)]
	for (ai, bi) in king_moves:
		(Ai, Bi) = (ai + A, bi + B)
		for (xi, yi) in knight_moves:
			if Ai + xi in d and Bi + yi in d[Ai + xi]:
				break
		else:
			check = False
			break
	if check:
		print('YES')
	else:
		print('NO')


defaultKnight = [(1, 2), (1, -2), (-1, 2), (-1, -2), (2, 1), (2, -1), (-2, 1), (-2, -1)]
defaultKing = [(0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (-1, 1), (-1, -1), (1, -1)]
for _ in range(int(input())):
	n = int(input())
	pos = []
	for _ in range(n):
		pos.append(list(map(int, input().split())))
	king = list(map(int, input().split()))
	dangerPos = []
	for each in pos:
		for eachPos in defaultKnight:
			dangerPos.append([each[0] + eachPos[0], each[1] + eachPos[1]])
	kingPos = []
	for eachPos in defaultKing:
		temp = [king[0] + eachPos[0], king[1] + eachPos[1]]
		if temp in dangerPos:
			kingPos.append(temp)
	if len(kingPos) < 8:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	n = int(input())
	overall = set()
	for j in range(n):
		(a, b) = map(int, input().split())
		knight_pos = {(a - 2, b - 1), (a - 2, b + 1), (a - 1, b - 2), (a - 1, b + 2), (a + 1, b - 2), (a + 1, b + 2), (a + 2, b - 1), (a + 2, b + 1)}
		overall.update(knight_pos)
	(x, y) = map(int, input().split())
	king_pos = {(x - 1, y - 1), (x - 1, y), (x - 1, y + 1), (x, y - 1), (x, y), (x, y + 1), (x + 1, y - 1), (x + 1, y), (x + 1, y + 1)}
	net = overall.intersection(king_pos)
	if net == king_pos:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	N = int(input())
	(kX, kY) = ([], [])
	for i in range(N):
		(t1, t2) = map(int, input().split())
		kX.append(t1)
		kY.append(t2)
	(A, B) = map(int, input().split())
	if A in kX or B in kY:
		print('YES')
	else:
		print('NO')


import sys

def inp():
	return sys.stdin.readline().strip()

def iinp():
	return int(inp())

def mp():
	return map(int, inp().split())

def liinp():
	return list(mp())

def lmps():
	return list(map(str, inp()))

def removeDuplicates(list1):
	return list(set(list1))

def lcm(obscureX, obscureY):
	if obscureX > obscureY:
		greater = obscureX
	else:
		obscuregreater = obscureY
	while True:
		if obscuregreater % obscureX == 0 and obscuregreater % obscureY == 0:
			obscurelcm = greater
			break
		obscuregreater += 1
	return obscurelcm

def knightPositions(a, b):
	return [[a + 2, b + 1], [a + 2, b - 1], [a - 2, b + 1], [a - 2, b - 1], [a + 1, b + 2], [a + 1, b - 2], [a - 1, b + 2], [a - 1, b - 2]]
for a in range(iinp()):
	n = iinp()
	knights = []
	for a in range(n):
		knights.append(liinp())
	k = liinp()
	positions = [[k[0] + 1, k[1] + 1], [k[0] + 1, k[1] - 1], [k[0] + 1, k[1] + 0], [k[0] + 0, k[1] + 1], [k[0] + 0, k[1] - 1], [k[0] + 0, k[1] + 0], [k[0] - 1, k[1] + 1], [k[0] - 1, k[1] - 1], [k[0] - 1, k[1] + 0]]
	all = 0
	for c in range(9):
		a = positions[c]
		for b in knights:
			if b in knightPositions(a[0], a[1]):
				all += 1
				break
		if all != c + 1:
			print('NO')
			break
	if all == 9:
		print('YES')


mapInput = lambda : map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	lst = []
	for i in range(n):
		xy = input().split()
		lst.append([int(j) for j in xy])
	(a, b) = mapInput()
	c = 0
	for i in lst:
		p = i[0]
		q = i[1]
		if abs(p - a) == 2 and abs(q - b) == 1:
			c = 1
			break
		elif abs(p - a) == 1 and abs(q - b) == 2:
			c = 1
			break
	if c == 1:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	ini = []
	for _ in range(n):
		pos = list(map(int, input().split(' ')))
		ini.append(pos)
	king = list(map(int, input().split(' ')))
	status = not any((abs(king[0] - ini[i][0]) == 1 and abs(king[1] - ini[i][1]) == 2 or (abs(king[0] - ini[i][0]) == 2 and abs(king[1] - ini[i][1]) == 1) for i in range(len(ini))))
	if not status:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l.append([int(x) for x in input().split()])
	(x, y) = map(int, input().split())
	c = False
	for j in l:
		a = j[0]
		b = j[1]
		if abs(x - a) == 2 and abs(y - b) == 1:
			c = True
			break
		elif abs(x - a) == 1 and abs(y - b) == 2:
			c = True
			break
	if c:
		print('YES')
	else:
		print('NO')


for ii in range(int(input())):
	nn = int(input())
	List = []
	for ii in range(nn):
		List.append([int(xx) for xx in input().split()])
	(XX, YY) = map(int, input().split())
	Check = False
	for ii in List:
		xx = ii[0]
		yy = ii[1]
		if abs(XX - xx) == 2 and abs(YY - yy) == 1:
			Check = True
			break
		elif abs(XX - xx) == 1 and abs(YY - yy) == 2:
			Check = True
			break
	if Check:
		print('YES')
	else:
		print('NO')


for t in range(int(input())):
	n = int(input())
	(x, y) = ([0] * n, [0] * n)
	for i in range(n):
		(x[i], y[i]) = map(int, input().split())
	(a, b) = map(int, input().split())
	c = [a, a, a, a + 1, a + 1, a + 1, a - 1, a - 1, a - 1]
	d = [b, b + 1, b - 1, b, b + 1, b - 1, b, b + 1, b - 1]
	e = 0
	for i in range(9):
		for j in range(n):
			if abs(c[i] - x[j]) + abs(d[i] - y[j]) == 3:
				e += 1
				break
	if e == 9:
		print('YES')
	else:
		print('NO')


testCases = int(input())
for testCase in range(testCases):
	n = int(input())
	knightPos = []
	for _ in range(n):
		knightPos.append(list(map(int, input().split())))
	kingPos = list(map(int, input().split()))
	knightMove = []
	for i in knightPos:
		knightMove.append([i[0] + 1, i[1] + 2])
		knightMove.append([i[0] + 2, i[1] + 1])
		knightMove.append([i[0] - 1, i[1] - 2])
		knightMove.append([i[0] - 2, i[1] - 1])
		knightMove.append([i[0] - 1, i[1] + 2])
		knightMove.append([i[0] - 2, i[1] + 1])
		knightMove.append([i[0] + 1, i[1] - 2])
		knightMove.append([i[0] + 2, i[1] - 1])
	kingMove = []
	kingMove.append([kingPos[0], kingPos[1]])
	kingMove.append([kingPos[0] + 1, kingPos[1] + 0])
	kingMove.append([kingPos[0] + 0, kingPos[1] + 1])
	kingMove.append([kingPos[0] - 1, kingPos[1] - 0])
	kingMove.append([kingPos[0] - 0, kingPos[1] - 1])
	kingMove.append([kingPos[0] - 1, kingPos[1] - 1])
	kingMove.append([kingPos[0] + 1, kingPos[1] + 1])
	kingMove.append([kingPos[0] - 1, kingPos[1] + 1])
	kingMove.append([kingPos[0] + 1, kingPos[1] - 1])
	canMove = False
	for i in kingMove:
		if i not in knightMove:
			canMove = True
			print('NO')
			break
	if canMove is False:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	knight_pos = []
	for __ in range(n):
		knight_pos.append(tuple(map(int, input().split())))
	king_pos = tuple(map(int, input().split()))
	king_moves = []
	for i in range(-1, 2):
		for j in range(-1, 2):
			king_moves.append((king_pos[0] + i, king_pos[1] + j))

	def f(king_moves, knight_pos):
		for a in knight_pos:
			for i in (-1, 1):
				for j in (-2, 2):
					try:
						if (a[0] + i, a[1] + j) in king_moves:
							king_moves.pop(king_moves.index((a[0] + i, a[1] + j)))
					except IndexError:
						return 'YES'
			for i in (-2, 2):
				for j in (-1, 1):
					try:
						if (a[0] + i, a[1] + j) in king_moves:
							king_moves.pop(king_moves.index((a[0] + i, a[1] + j)))
					except IndexError:
						return 'YES'
		if len(king_moves) == 0:
			return 'YES'
		else:
			return 'NO'
	print(f(king_moves, knight_pos))


try:
	t = int(input())
	while t > 0:
		n = int(input())
		l1 = []
		for i in range(n):
			(a, b) = list(map(int, input().split()))
			l1.append((a + 1, b + 2))
			l1.append((a + 2, b + 1))
			l1.append((a - 2, b - 1))
			l1.append((a - 1, b - 2))
			l1.append((a + 1, b - 2))
			l1.append((a - 2, b + 1))
			l1.append((a + 2, b - 1))
			l1.append((a - 1, b + 2))
		(x, y) = list(map(int, input().split()))
		ans = 'YES'
		for u in range(x - 1, x + 2):
			for v in range(y - 1, y + 2):
				if (u, v) not in l1:
					ans = 'NO'
		print(ans)
except:
	pass


for i in range(int(input())):
	mylist = []
	F = []
	count = 0
	for i in range(int(input())):
		(i, j) = list(map(int, input().split()))
		L = [[i + 1, j + 2], [i - 1, j + 2], [i + 2, j + 1], [i + 2, j - 1], [i + 1, j - 2], [i - 1, j - 2], [i - 2, j + 1], [i - 2, j - 1]]
		F.extend(L)
	(A, B) = list(map(int, input().split()))
	X = [[A, B], [A + 1, B + 1], [A - 1, B - 1], [A + 1, B - 1], [A - 1, B + 1], [A, B + 1], [A + 1, B], [A, B - 1], [A - 1, B]]
	for i in X:
		for j in F:
			if i == j:
				count += 1
				break
	if count == 9:
		print('YES')
	else:
		print('NO')


T = int(input())

def addXY(dict, x, y):
	if x not in dict:
		dict[x] = {}
		dict[x][y] = True
	else:
		dict[x][y] = True
for _ in range(T):
	N = int(input())
	knightsPositions = []
	notAllowed = {}
	for _2 in range(N):
		(x, y) = [int(i) for i in input().split(' ')]
		x1 = x - 1
		y1 = y + 2
		addXY(notAllowed, x1, y1)
		x1 = x - 2
		y1 = y + 1
		addXY(notAllowed, x1, y1)
		x1 = x - 2
		y1 = y - 1
		addXY(notAllowed, x1, y1)
		x1 = x - 1
		y1 = y - 2
		addXY(notAllowed, x1, y1)
		x1 = x + 1
		y1 = y - 2
		addXY(notAllowed, x1, y1)
		x1 = x + 2
		y1 = y - 1
		addXY(notAllowed, x1, y1)
		x1 = x + 2
		y1 = y + 1
		addXY(notAllowed, x1, y1)
		x1 = x + 1
		y1 = y + 2
		addXY(notAllowed, x1, y1)
	(x, y) = [int(i) for i in input().split(' ')]
	if x in notAllowed:
		if y in notAllowed[x]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	arr = [list(map(int, input().split())) for i in range(n)]
	(a, b) = map(int, input().split())
	c = True
	for i in arr:
		if i[0] == a or i[1] == b:
			print('YES')
			c = False
			break
	if c:
		print('NO')


tests = int(input())
for i in range(tests):
	knights = int(input())
	knights_arr = []
	for j in range(knights):
		knight_pos = list(map(int, input().split()))
		knights_arr.append(knight_pos)
	king_pos = list(map(int, input().split()))
	req_checkmate_pos = {(king_pos[0], king_pos[1]), (king_pos[0] - 1, king_pos[1]), (king_pos[0] - 1, king_pos[1] - 1), (king_pos[0], king_pos[1] - 1), (king_pos[0] + 1, king_pos[1] - 1), (king_pos[0] + 1, king_pos[1]), (king_pos[0] + 1, king_pos[1] + 1), (king_pos[0], king_pos[1] + 1), (king_pos[0] - 1, king_pos[1] + 1)}
	for j in knights_arr:
		if (j[0] + 1, j[1] - 2) in req_checkmate_pos:
			req_checkmate_pos.remove((j[0] + 1, j[1] - 2))
		if (j[0] - 1, j[1] - 2) in req_checkmate_pos:
			req_checkmate_pos.remove((j[0] - 1, j[1] - 2))
		if (j[0] + 1, j[1] + 2) in req_checkmate_pos:
			req_checkmate_pos.remove((j[0] + 1, j[1] + 2))
		if (j[0] - 1, j[1] + 2) in req_checkmate_pos:
			req_checkmate_pos.remove((j[0] - 1, j[1] + 2))
		if (j[0] + 2, j[1] + 1) in req_checkmate_pos:
			req_checkmate_pos.remove((j[0] + 2, j[1] + 1))
		if (j[0] + 2, j[1] - 1) in req_checkmate_pos:
			req_checkmate_pos.remove((j[0] + 2, j[1] - 1))
		if (j[0] - 2, j[1] + 1) in req_checkmate_pos:
			req_checkmate_pos.remove((j[0] - 2, j[1] + 1))
		if (j[0] - 2, j[1] - 1) in req_checkmate_pos:
			req_checkmate_pos.remove((j[0] - 2, j[1] - 1))
		if len(req_checkmate_pos) == 0:
			break
	if len(req_checkmate_pos) == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	x = []
	z = n
	Flag = True
	while z:
		(x1, y1) = map(int, input().split())
		x.append((x1, y1))
		z = z - 1
	(a, b) = map(int, input().split())
	kimove = [(a + 1, b), (a - 1, b), (a, b + 1), (a + 1, b - 1), (a + 1, b + 1), (a + 1, b - 1), (a - 1, b + 1), (a - 1, b - 1)]
	knmove = []
	for i in range(n):
		(x1, y1) = x[i]
		knmove.append((x1 + 2, y1 - 1))
		knmove.append((x1 + 2, y1 + 1))
		knmove.append((x1 - 2, y1 - 1))
		knmove.append((x1 - 2, y1 + 1))
		knmove.append((x1 - 1, y1 - 2))
		knmove.append((x1 + 1, y1 - 2))
		knmove.append((x1 + 1, y1 + 2))
		knmove.append((x1 - 1, y1 + 1))
	knmove = set(knmove)
	knmove = list(knmove)
	for i in kimove:
		if i in knmove:
			Flag = True
		else:
			Flag = False
	if Flag:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	x = int(input())
	arr1 = []
	arr2 = []
	for i in range(x):
		(a, b) = list(map(int, input().split()))
		arr1.append(a)
		arr2.append(b)
	(a, b) = map(int, input().split())
	arrx = [a, a - 1, a + 1]
	arry = [b, b - 1, b + 1]
	for i in arrx:
		if i in arr1:
			print('YES')
			break
	else:
		for i in arry:
			if i in arr2:
				print('YES')
				break
		else:
			print('NO')


for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		temp = list(map(int, input().split()))
		a.append(temp)
	(x, y) = map(int, input().split())

	def moves(x, y):
		l = []
		l.append([x + 1, y + 2])
		l.append([x + 2, y + 1])
		l.append([x - 2, y + 1])
		l.append([x - 1, y + 2])
		l.append([x + 1, y - 2])
		l.append([x + 2, y - 1])
		l.append([x - 2, y - 1])
		l.append([x - 1, y - 2])
		return l
	l = [[x, y]]
	l.append([x + 1, y + 1])
	l.append([x, y + 1])
	l.append([x + 1, y])
	l.append([x - 1, y + 1])
	l.append([x - 1, y])
	l.append([x, y - 1])
	l.append([x + 1, y - 1])
	l.append([x - 1, y - 1])
	for i in a:
		move = moves(i[0], i[1])
		if len(l):
			for j in move:
				if j in l:
					l.remove(j)
		else:
			break
	if len(l):
		print('NO')
		continue
	print('YES')


for _ in range(int(input())):
	moves_li = []
	k_moves_li = []
	n = int(input())
	ans = 'YES'
	for i in range(n):
		(x, y) = map(int, input().split())
		moves = [(x - 1, y + 2), (x + 1, y + 2), (x + 2, y + 1), (x + 2, y - 1), (x + 1, y - 2), (x - 1, y - 2), (x - 2, y - 1), (x - 2, y + 1)]
		moves_li.extend(moves)
	(x, y) = map(int, input().split())
	k_moves_li = [(x, y), (x, y + 1), (x + 1, y + 1), (x + 1, y), (x + 1, y - 1), (x, y - 1), (x - 1, y - 1), (x - 1, y), (x - 1, y + 1)]
	for km in k_moves_li:
		if km not in moves_li:
			ans = 'NO'
			break
	print(ans)


import math
from collections import Counter
from itertools import combinations, permutations

def solve():
	N = int(input())
	lis = []
	for i in range(N):
		X = list(map(int, input().split()))
		lis.append(X)
	(A, B) = list(map(int, input().split()))
	ans = True
	for i in range(N):
		if abs(A - lis[i][0]) + abs(B - lis[i][1]) == 3:
			ans = False
			break
	if ans == False:
		print('YES')
	else:
		all_pos = [[A + 1, B + 1], [A - 1, B - 1], [A - 1, B], [A + 1, B], [A + 1, B - 1], [A - 1, B + 1]]
		for j in range(len(lis)):
			for k in range(len(all_pos)):
				if abs(lis[j][0] - all_pos[k][0]) + abs(lis[j][1] - all_pos[k][1]) == 3:
					ans = False
					break
		if ans == False:
			print('YES')
		else:
			print('NO')
for _ in range(int(input())):
	solve()


def check(p1, p2):
	(x1, y1) = p1
	(x2, y2) = p2
	if abs(x1 - x2) == 2 and abs(y1 - y2) == 1 or (abs(x1 - x2) == 1 and abs(y1 - y2) == 2):
		return True
	else:
		return False
T = int(input())
for k in range(T):
	n = int(input())
	knights = []
	for r in range(n):
		kn = tuple(map(int, input().split(' ')))
		knights.append(kn)
	(A, B) = tuple(map(int, input().split(' ')))
	check_mate = 1
	for x in [A - 1, A, A + 1]:
		for y in [B - 1, B, B + 1]:
			c = 0
			for kn in knights:
				if check(kn, (x, y)):
					c = 1
					break
			if c == 0:
				check_mate = 0
				break
		if check_mate == 0:
			break
	if check_mate == 0:
		print('NO')
	elif check_mate == 1:
		print('YES')


for t in range(int(input())):
	tot = int(input()) + 1
	check = False
	l = []
	for _ in range(tot):
		(x, y) = map(int, input().split())
		l.append([x, y])
	(k_x, k_y) = (l[-1][0], l[-1][1])
	l.pop()
	for i in range(tot - 1):
		if abs(l[i][0] - k_x) == 1 and abs(l[i][1] - k_y) == 2 or (abs(l[i][0] - k_x) == 2 and abs(l[i][1] - k_y) == 1):
			check = True
			break
	if not check:
		print('NO')
	else:
		cnt = 0
		move = [[k_x - 1, k_y], [k_x + 1, k_y], [k_x, k_y - 1], [k_x, k_y + 1], [k_x - 1, k_y - 1], [k_x - 1, k_y + 1], [k_x + 1, k_y - 1], [k_x + 1, k_y + 1]]
		for i in range(8):
			for j in range(tot - 1):
				if abs(l[j][0] - move[i][0]) == 1 and abs(l[j][1] - move[i][1]) == 2 or (abs(l[j][0] - move[i][0]) == 2 and abs(l[j][1] - move[i][1]) == 1):
					cnt += 1
		if cnt >= 8:
			print('YES')
		else:
			print('NO')


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	kmove = []
	for i in range(n):
		(x, y) = list(map(int, input().split()))
		kmove.append([x + 1, y + 2])
		kmove.append([x + 1, y - 2])
		kmove.append([x + 2, y + 1])
		kmove.append([x + 2, y - 1])
		kmove.append([x - 1, y - 2])
		kmove.append([x - 1, y + 2])
		kmove.append([x - 2, y - 1])
		kmove.append([x - 2, y + 1])
	(a, b) = list(map(int, input().split()))
	ok = 0
	king = [[a, b], [a + 1, b + 1], [a + 1, b], [a + 1, b - 1], [a, b + 1], [a, b - 1], [a - 1, b], [a - 1, b - 1], [a - 1, b + 1]]
	for i in king:
		if i not in kmove:
			print('NO')
			ok = 1
			break
	if ok == 0:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	blocked = set()
	count = 0
	for k in range(n):
		j = list(map(int, input().split()))
		blocked |= {(j[0] + 1, j[1] + 2), (j[0] + 2, j[1] + 1), (j[0] - 2, j[1] + 1), (j[0] - 1, j[1] + 2), (j[0] + 2, j[1] - 1), (j[0] + 1, j[1] - 2), (j[0] - 1, j[1] - 2), (j[0] - 2, j[1] - 1)}
	king = tuple(map(int, input().split()))
	kings = [(king[0] + 1, king[1] + 1), (king[0], king[1] + 1), (king[0] + 1, king[1]), (king[0] + 1, king[1] - 1), (king[0] - 1, king[1] + 1), (king[0] - 1, king[1] - 1), (king[0] - 1, king[1]), (king[0], king[1] - 1)]
	for i in kings:
		if i in blocked:
			count += 1
	if king in blocked and count == 8:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	lst = [list(map(int, input().split())) for i in range(n)]
	(a, b) = map(int, input().split())
	for i in lst:
		if i[0] == a or i[1] == b:
			print('YES')
			break
	else:
		print('NO')


T = int(input())
for x in range(T):
	n = int(input())
	tim = True
	l = [list(map(int, input().split())) for i in range(n)]
	(a, b) = map(int, input().split())
	for i in l:
		if i[0] == a or i[1] == b:
			print('YES')
			tim = False
			break
	if tim:
		print('NO')


for _ in range(int(input())):
	(n, flag) = (int(input()), 0)
	l = [list(map(int, input().split())) for _ in range(n)]
	(a, b) = map(int, input().split())
	for i in l:
		if i[0] == a or i[1] == b:
			flag = 1
	if flag == 1:
		print('YES')
	else:
		print('NO')


tc = int(input())
for _ in range(tc):
	n = int(input())
	lis = []
	for i in range(n):
		(x, y) = map(int, input().split())
		lis.append((x + 1, y + 2))
		lis.append((x + 1, y - 2))
		lis.append((x + 2, y + 1))
		lis.append((x + 2, y - 1))
		lis.append((x - 1, y - 2))
		lis.append((x - 1, y + 2))
		lis.append((x - 2, y + 1))
		lis.append((x - 2, y - 1))
	(i, j) = map(int, input().split())
	ans = 'YES'
	for u in range(i - 1, i + 2):
		for v in range(j - 1, j + 2):
			if (u, v) not in lis:
				ans = 'NO'
				break
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	x = []
	y = []
	for j in range(n):
		a = [int(x) for x in input().split()]
		x.append(a[0])
		y.append(a[1])
	k = [int(x) for x in input().split()]
	c = 'NO'
	for l in range(n):
		if x[l] + 2 == k[0] and (y[l] + 1 == k[1] or y[l] - 1 == k[1]):
			c = 'YES'
		if x[l] - 2 == k[0] and (y[l] + 1 == k[1] or y[l] - 1 == k[1]):
			c = 'YES'
		if y[l] - 2 == k[1] and (x[l] + 1 == k[0] or x[l] - 1 == k[0]):
			c = 'YES'
		if y[l] + 2 == k[1] and (x[l] + 1 == k[0] or x[l] - 1 == k[0]):
			c = 'YES'
	print(c)


for _ in range(int(input())):
	n = int(input())
	knight_moves = set()
	king_moves = set()
	for _ in range(n):
		(x_i, y_i) = map(int, input().split())
		knight_moves.add((x_i + 2, y_i + 1))
		knight_moves.add((x_i + 2, y_i - 1))
		knight_moves.add((x_i - 2, y_i + 1))
		knight_moves.add((x_i - 2, y_i - 1))
		knight_moves.add((x_i + 1, y_i + 2))
		knight_moves.add((x_i - 1, y_i + 2))
		knight_moves.add((x_i + 1, y_i - 2))
		knight_moves.add((x_i - 1, y_i - 2))
	(k_x, k_y) = map(int, input().split())
	knight_moves.add((k_x + 1, k_y))
	knight_moves.add((k_x - 1, k_y))
	knight_moves.add((k_x, k_y + 1))
	knight_moves.add((k_x, k_y - 1))
	knight_moves.add((k_x + 1, k_y + 1))
	knight_moves.add((k_x + 1, k_y - 1))
	knight_moves.add((k_x - 1, k_y + 1))
	knight_moves.add((k_x - 1, k_y - 1))
	if (k_x, k_y) in knight_moves and knight_moves.intersection(king_moves) == king_moves:
		print('YES')
	else:
		print('NO')