Berland crossword is a puzzle that is solved on a square grid with $n$ rows and $n$ columns. Initially all the cells are white.

To solve the puzzle one has to color some cells on the border of the grid black in such a way that:

exactly $U$ cells in the top row are black;

exactly $R$ cells in the rightmost column are black;

exactly $D$ cells in the bottom row are black;

exactly $L$ cells in the leftmost column are black.

Note that you can color zero cells black and leave every cell white.

Your task is to check if there exists a solution to the given puzzle.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 1000$) — the number of testcases.

Then the descriptions of $t$ testcases follow.

The only line of each testcase contains $5$ integers $n, U, R, D, L$ ($2 \le n \le 100$; $0 \le U, R, D, L \le n$).


-----Output-----

For each testcase print "YES" if the solution exists and "NO" otherwise.

You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES are all recognized as positive answer).


-----Examples-----

Input
4
5 2 5 3 1
3 0 0 0 0
4 4 1 4 0
2 1 1 1 1
Output
YES
YES
NO
YES


-----Note-----

Here are possible solutions to testcases $1$, $2$ and $4$:

Source: codeforces | Difficulty: MEDIUM
Tags: Complete search

Bit manipulation

Implementation

Greedy algorithms


Solutions:
import sys
YES = 'YES'
NO = 'NO'
MOD = 1000000007

def input_int():
	return int(input())

def input_list():
	return input().split(' ')

def input_list_int():
	return list(map(int, input_list()))

def solve():
	a = input_list_int()
	n = a[0]
	b = [0] * 5
	for i in range(1, 5):
		pr = i - 1
		ne = i + 1
		if pr == 0:
			pr = 4
		if ne == 5:
			ne = 1
		if a[i] == n:
			b[pr] += 1
			b[ne] += 1
		if a[i] == n - 1:
			if a[pr] == a[ne]:
				if b[pr] > b[ne]:
					b[ne] += 1
				else:
					b[pr] += 1
			elif a[pr] > a[ne]:
				b[pr] += 1
			else:
				b[ne] += 1
	for i in range(1, 5):
		if b[i] > a[i]:
			print(NO)
			return
	print(YES)
query_count = input_int()
while query_count:
	query_count -= 1
	solve()


def solve():
	(n, u, r, d, l) = map(int, input().split())
	a = [u, r, d, l]
	for i in range(2):
		s1 = max(0, a[i] - (n - 1)) + max(0, a[i + 2] - (n - 1))
		if s1 > a[i + 1] or s1 > a[(i + 3) % 4]:
			return 'NO'
		s2 = max(0, a[i] - (n - 2)) + max(0, a[i + 2] - (n - 2))
		if s2 > a[i + 1] + a[(i + 3) % 4]:
			return 'NO'
	return 'YES'
for _ in range(int(input())):
	print(solve())


tc = int(input())
for _ in range(tc):
	(s, u, r, d, l) = list(map(int, input().split()))
	side = [u, r, d, l]
	temp = [0, 0, 0, 0]
	if u == s:
		temp[1] += 1
		temp[3] += 1
	if d == s:
		temp[1] += 1
		temp[3] += 1
	if r == s:
		temp[0] += 1
		temp[2] += 1
	if l == s:
		temp[0] += 1
		temp[2] += 1
	if u == s - 1:
		if r - temp[1] < l - temp[3]:
			temp[3] += 1
		else:
			temp[1] += 1
	if d == s - 1:
		if r - temp[1] < l - temp[3]:
			temp[3] += 1
		else:
			temp[1] += 1
	if r == s - 1:
		if u - temp[0] < d - temp[2]:
			temp[2] += 1
		else:
			temp[0] += 1
	if l == s - 1:
		if u - temp[0] < d - temp[2]:
			temp[2] += 1
		else:
			temp[0] += 1
	flag = True
	for i in range(len(side)):
		if side[i] - temp[i] < 0:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, U, R, D, L) = map(int, input().split())
	if U >= 2 and R >= 2 and (D >= 2) and (L >= 2):
		print('YES')
	else:
		flag = 1
		if U + D == 0:
			if L > n - 2 or R > n - 2:
				flag = 0
		if L + R == 0:
			if U > n - 2 or D > n - 2:
				flag = 0
		if U + D == 1:
			if L + R > 2 * n - 3 or L == n or R == n:
				flag = 0
		if U + D == 2:
			if L + R > 2 * n - 2:
				flag = 0
		if L + R == 1:
			if U + D > 2 * n - 3 or U == n or D == n:
				flag = 0
		if L + R == 2:
			if U + D > 2 * n - 2:
				flag = 0
		if U + D == 3:
			if L == n and R == n:
				flag = 0
		if L + R == 3:
			if U == n and D == n:
				flag = 0
		if U == 0 or D == 0:
			if L > n - 1 or R > n - 1:
				flag = 0
		if U == 1 or D == 1:
			if L + R > 2 * n - 1:
				flag = 0
		if L == 0 or R == 0:
			if U > n - 1 or D > n - 1:
				flag = 0
		if L == 1 or R == 1:
			if U + D > 2 * n - 1:
				flag = 0
		if flag == 1:
			print('YES')
		else:
			print('NO')


for ct in range(int(input())):
	(n, U, R, D, L) = map(int, input().split())
	possible = False
	for a in range(2):
		for b in range(2):
			for c in range(2):
				for d in range(2):
					valid = True
					(x, y, z, w) = (U - a, R - a, D - b, L - c)
					x -= d
					y -= b
					z -= c
					w -= d
					if x < 0 or y < 0 or z < 0 or (w < 0):
						valid = False
					if x > n - 2 or y > n - 2 or z > n - 2 or (w > n - 2):
						valid = False
					if valid:
						possible = True
	print('YES') if possible else print('NO')


def main() -> None:
	a = list(map(int, input().split()))
	n = a[0]
	a = list(map(lambda x: (max(0, x - n + 2), min(2, x)), a[1:]))
	for i in range(4):
		if a[i][0] == 2 and a[(i + 1) % 4][1] == 0 or (a[i][1] == 0 and a[(i + 1) % 4][0] == 2):
			print('NO')
			return
	if a[0][0] + a[2][0] > a[1][1] + a[3][1] or a[0][1] + a[2][1] < a[1][0] + a[3][0]:
		print('NO')
	else:
		print('YES')
	return
t = int(input())
for _ in range(t):
	main()


tt = int(input())
while tt:
	(n, U, R, D, L) = map(int, input().split())
	for mask in range(16):
		(rU, rR, rD, rL) = (U, R, D, L)
		if mask & 1:
			rU -= 1
			rL -= 1
		if mask & 2:
			rL -= 1
			rD -= 1
		if mask & 4:
			rD -= 1
			rR -= 1
		if mask & 8:
			rR -= 1
			rU -= 1
		if min(rU, rR, rD, rL) >= 0 and max(rU, rR, rD, rL) <= n - 2:
			print('YES')
			break
	else:
		print('NO')
	tt -= 1


import sys, os, io
from sys import stdin
from math import log, gcd, ceil
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import math
alphabets = list('abcdefghijklmnopqrstuvwxyz')

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def si():
	return input()

def prefix_sum(arr):
	r = [0] * (len(arr) + 1)
	for (i, el) in enumerate(arr):
		r[i + 1] = r[i] + el
	return r

def divideCeil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')

def power_set(L):
	cardinality = len(L)
	n = 2 ** cardinality
	powerset = []
	for i in range(n):
		a = bin(i)[2:]
		subset = []
		for j in range(len(a)):
			if a[-j - 1] == '1':
				subset.append(L[j])
		powerset.append(subset)
	powerset_orderred = []
	for k in range(cardinality + 1):
		for w in powerset:
			if len(w) == k:
				powerset_orderred.append(w)
	return powerset_orderred

def fastPlrintNextLines(a):
	print('\n'.join(map(str, a)))

def sortByFirstAndSecond(A):
	A = sorted(A, key=lambda x: x[0])
	A = sorted(A, key=lambda x: x[1])
	return list(A)
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def fun(u, r, d, l, n):
	if (u == n or d == n) and (l == 0 or r == 0):
		return False
	if (u == n - 1 or d == n - 1) and (l == 0 and r == 0):
		return False
	if u == n and d == n and (l < 2 or r < 2):
		return False
	if (u == n and d == n - 1 or (u == n - 1 and d == n)) and (l < 2 and r < 2):
		return False
	if (u >= n - 1 or d >= n - 1) and (l == 0 and r == 0):
		return False
	return True

def solve():
	(n, u, r, d, l) = li()
	m = max(u, r, l, d)
	if m > n:
		print('NO')
		return
	m = 0
	m = (d == n) + (u == n)
	x = (d == n - 1) + (u == n - 1)
	y = (l == n) + (r == n)
	z = (l == n - 1) + (r == n - 1)
	if (r < m or l < m or u < y or (d < y)) or (l + r < x + m + m or u + d < z + y + y):
		print('NO')
		return
	else:
		print('YES')
		return
t = 1
t = int(input())
for _ in range(t):
	solve()


def solve():
	(n, u, r, d, l) = map(int, input().split())
	u1 = u
	l1 = l
	r1 = r
	d1 = d
	if u1 == n:
		l = l - 1
		r = r - 1
	if d1 == n:
		l = l - 1
		r = r - 1
	if l1 == n:
		u = u - 1
		d = d - 1
	if r1 == n:
		u = u - 1
		d = d - 1
	if u1 == n - 1:
		if r > l:
			r = r - 1
		else:
			l = l - 1
	if d1 == n - 1:
		if r > l:
			r = r - 1
		else:
			l = l - 1
	if r1 == n - 1:
		if d > u:
			d = d - 1
		else:
			u = u - 1
	if l1 == n - 1:
		if d > u:
			d = d - 1
		else:
			u = u - 1
	if l < 0 or r < 0 or d < 0 or (u < 0):
		print('NO')
	else:
		print('YES')
for tetsis in range(int(input())):
	solve()


for s in [*open(0)][1:]:
	(n, *a) = map(int, s.split())
	b = {*a}
	a *= 2
	print('YNEOS'[all(({n - 1, n} & b, {0, 1} & b, {0, n} & b)) and any((0 < u < n > v > 0 and (x < n - 1 > y or x > 1 < y) or (0 < v < n > u + 1 and x > 1 and (0 < y < n)) for (u, v, x, y) in zip(a, a[1:], a[2:], a[3:]))) < 1::2])


import sys
input = sys.stdin.readline
for f in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	mnv = mnh = 0
	if u >= n - 1:
		mnh += u - n + 2
	if r >= n - 1:
		mnv += r - n + 2
	if d >= n - 1:
		mnh += d - n + 2
	if l >= n - 1:
		mnv += l - n + 2
	ans = 'YES'
	if u + d < mnv:
		ans = 'NO'
	if r + l < mnh:
		ans = 'NO'
	if (u == n or d == n) and (r == 0 or l == 0):
		ans = 'NO'
	if (r == n or l == n) and (u == 0 or d == 0):
		ans = 'NO'
	if (u == n and d == n) and (r == 1 or l == 1):
		ans = 'NO'
	if (r == n and l == n) and (u == 1 or d == 1):
		ans = 'NO'
	print(ans)


t = int(input())
for i in range(t):
	(n, u, r, d, l) = [int(k) for k in input().split()]
	(a, b, c) = (r, l, 0)
	for j in [u, d]:
		if j == n:
			a -= 1
			b -= 1
		elif j == n - 1:
			c += 1
	if a < 0 or b < 0 or a + b - c < 0:
		print('NO')
		continue
	(a, b, c) = (u, d, 0)
	for j in [l, r]:
		if j == n:
			a -= 1
			b -= 1
		elif j == n - 1:
			c += 1
	if a < 0 or b < 0 or a + b - c < 0:
		print('NO')
		continue
	print('YES')


for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	for csel in range(16):
		(u1, r1, d1, l1) = (u, r, d, l)
		if csel & 1:
			(l1, u1) = (l1 - 1, u1 - 1)
		if csel & 2:
			(u1, r1) = (u1 - 1, r1 - 1)
		if csel & 4:
			(r1, d1) = (r1 - 1, d1 - 1)
		if csel & 8:
			(d1, l1) = (d1 - 1, l1 - 1)
		possible = True
		for i in (l1, u1, r1, d1):
			if i < 0 or i > n - 2:
				possible = False
				break
		if possible:
			break
	print(['NO', 'YES'][possible])


import os
import sys
from io import BytesIO, IOBase
import math
import itertools
import bisect
import heapq

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n / i
	if n > 2:
		l.append(int(n))
	return l

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def maxPrimeFactors(n):
	maxPrime = -1
	while n % 2 == 0:
		maxPrime = 2
		n >>= 1
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			maxPrime = i
			n = n / i
	if n > 2:
		maxPrime = n
	return int(maxPrime)

def countcon(s, i):
	c = 0
	ch = s[i]
	for i in range(i, len(s)):
		if s[i] == ch:
			c += 1
		else:
			break
	return c

def lis(arr):
	n = len(arr)
	lis = [1] * n
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] > arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
	maximum = 0
	for i in range(n):
		maximum = max(maximum, lis[i])
	return maximum

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def maxfac(n):
	root = int(n ** 0.5)
	for i in range(2, root + 1):
		if n % i == 0:
			return n // i
	return n

def p2(n):
	c = 0
	while n % 2 == 0:
		n //= 2
		c += 1
	return c

def seive(n):
	primes = [True] * (n + 1)
	primes[1] = primes[0] = False
	for i in range(2, n + 1):
		if primes[i]:
			for j in range(i + i, n + 1, i):
				primes[j] = False
	p = []
	for i in range(0, n + 1):
		if primes[i]:
			p.append(i)
	return p

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def denofactinverse(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return pow(fac, m - 2, m)

def numofact(n, m):
	fac = 1
	for i in range(1, n + 1):
		fac = fac * i % m
	return fac

def sumnum(n):
	s = 0
	for i in str(n):
		s += int(i)
	return s

def chk(u, d, l, r):
	minl = 0
	minr = 0
	if u == n - 1 and d == n - 1:
		if r == 0 and l < 2:
			return False
		else:
			return True
	if u == n:
		minl += 1
		minr += 1
	if d == n:
		minl += 1
		minr += 1
	if u == n - 1:
		minl += 1
	if d == n - 1:
		minl += 1
	if l < minl or r < minr:
		return False
	else:
		return True
for xyz in range(0, int(input())):
	(n, u, r, d, l) = map(int, input().split())
	(u, d, l, r) = (max(u, d), min(u, d), max(l, r), min(l, r))
	if chk(u, d, l, r) and chk(l, r, u, d):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, U, R, D, L) = map(int, input().split())
	(tu, tr, td, tl) = (U, R, D, L)
	if U == n:
		tr -= 1
		tl -= 1
	elif U == n - 1:
		if tr > tl:
			tr -= 1
		else:
			tl -= 1
	if D == n:
		tr -= 1
		tl -= 1
	elif D == n - 1:
		if tr > tl:
			tr -= 1
		else:
			tl -= 1
	if R == n:
		td -= 1
		tu -= 1
	elif R == n - 1:
		if tu > td:
			tu -= 1
		else:
			td -= 1
	if L == n:
		td -= 1
		tu -= 1
	elif L == n - 1:
		if tu > td:
			tu -= 1
		else:
			td -= 1
	if min(tu, tr, td, tl) < 0:
		print('NO')
	else:
		print('YES')


def solution(n, u, r, d, l):
	found = False
	for i in range(16):
		ur = i >> 3 & 1
		rd = i >> 2 & 1
		dl = i >> 1 & 1
		lu = i & 1
		n2 = n - 2
		if u - ur - lu <= n2 and r - ur - rd <= n2 and (d - rd - dl <= n2) and (l - dl - lu <= n2) and (u - ur - lu >= 0) and (r - ur - rd >= 0) and (d - rd - dl >= 0) and (l - dl - lu >= 0):
			found = True
			break
	print('YES' if found else 'NO')

def main():
	for _ in range(int(input())):
		solution(*map(int, input().split()))
main()


def fun(n, u, r, d, l):
	ls = [u, r, d, l]
	if u == n and d == n:
		if l < 2 or r < 2:
			print('no')
			return
	if u == n - 1 and d == n or (d == n - 1 and u == n):
		if l >= 1 and r >= 2 or (l >= 2 and r >= 1):
			pass
		else:
			print('no')
			return
	if l == n and r == n:
		if u < 2 or d < 2:
			print('no')
			return
	if l == n - 1 and r == n or (r == n - 1 and l == n):
		if u >= 1 and d >= 2 or (u >= 2 and d >= 1):
			pass
		else:
			print('no')
			return
	if u == n and d < n - 1 or (d == n and u < n - 1):
		if l < 1 or r < 1:
			print('no')
			return
	if l == n and r < n - 1 or (r == n and l < n - 1):
		if u < 1 or d < 1:
			print('no')
			return
	if u == n - 1 and d < n - 1 or (d == n - 1 and u < n - 1):
		if l >= 1 and r >= 0 or (r >= 1 and l >= 0):
			pass
		else:
			print('no')
			return
	if l == n - 1 and r < n - 1 or (r == n - 1 and l < n - 1):
		if u >= 1 and d >= 0 or (d >= 1 and u >= 0):
			pass
		else:
			print('no')
			return
	if l == n - 1 and r == n - 1:
		if u >= 2 and d >= 0 or (d >= 2 and u >= 0) or (d >= 1 and u >= 1):
			pass
		else:
			print('no')
			return
	if u == n - 1 and d == n - 1:
		if l >= 2 and r >= 0 or (r >= 2 and l >= 0) or (l >= 1 and r >= 1):
			pass
		else:
			print('no')
			return
	print('yes')
T = int(input())
for i in range(T):
	(n, u, r, d, l) = list(map(int, input().split()))
	fun(n, u, r, d, l)


for kvxj in range(int(input())):
	(n, a, b, c, d) = map(int, input().split())
	a1 = max(0, a - n + 2)
	a2 = min(a, 2)
	b1 = max(0, b - n + 2)
	b2 = min(b, 2)
	c1 = max(0, c - n + 2)
	c2 = min(c, 2)
	d1 = max(0, d - n + 2)
	d2 = min(d, 2)
	x = 0
	if a1 + c1 > b2 + d2:
		x = 1
	elif b1 + d1 > a2 + c2:
		x = 1
	elif max(a1, c1) == 2 and min(b2, d2) == 0:
		x = 1
	elif max(b1, d1) == 2 and min(a2, c2) == 0:
		x = 1
	print(['YES', 'NO'][x])


T = int(input())
for t in range(T):
	(n, u, r, d, l) = map(int, input().split())
	xs = [u, r, d, l]
	if any((x > n for x in xs)):
		print('NO')
		continue
	ans = True
	for (i, x) in enumerate(xs):
		opp = xs[i - 2]
		lef = xs[i - 1]
		rig = xs[i - 3]
		if x == n - 1:
			needs = 1 + max(0, opp - (n - 2))
			if lef + rig < needs:
				ans = False
		elif x == n:
			needs = 2 if opp == n else 1
			if lef < needs or rig < needs:
				ans = False
	print('YES' if ans else 'NO')


for _ in range(int(input())):
	(n, U, R, D, L) = map(int, input().split())
	for mask in range(16):
		(tu, tr, td, tl) = (U, R, D, L)
		if mask & 1:
			tu -= 1
			tl -= 1
		if mask & 2:
			td -= 1
			tr -= 1
		if mask & 4:
			tu -= 1
			tr -= 1
		if mask & 8:
			td -= 1
			tl -= 1
		if min(tu, tr, td, tl) >= 0 and max(tu, tr, td, tl) <= n - 2:
			print('YES')
			break
	else:
		print('NO')


def solve(bit, can):
	for i in range(4):
		if bit & 1 << i:
			A[i] -= 1
			A[(i + 1) % 4] -= 1
	if 0 <= min(A) and max(A) <= n - 2:
		for i in range(4):
			if bit & 1 << i:
				A[i] += 1
				A[(i + 1) % 4] += 1
		return True
	else:
		for i in range(4):
			if bit & 1 << i:
				A[i] += 1
				A[(i + 1) % 4] += 1
		return can
for _ in range(int(input())):
	can = False
	(n, u, r, d, l) = map(int, input().split())
	A = [u, r, d, l]
	for bit in range(2 ** 4):
		can = solve(bit, can)
	print('YES' if can else 'NO')


import os
import sys
from io import BytesIO, IOBase

def mul_input():
	return map(int, input().split())

def arr_input():
	return list(map(int, input().split()))

def solve():
	(n, u, r, d, l) = mul_input()
	u1 = u
	r1 = r
	d1 = d
	l1 = l
	if u == n:
		l1 -= 1
		r1 -= 1
	elif u == n - 1:
		if r1 > l1:
			r1 -= 1
		else:
			l1 -= 1
	if d == n:
		l1 -= 1
		r1 -= 1
	elif d == n - 1:
		if r1 > l1:
			r1 -= 1
		else:
			l1 -= 1
	if r == n:
		u1 -= 1
		d1 -= 1
	elif r == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	if l == n:
		u1 -= 1
		d1 -= 1
	elif l == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	if u1 >= 0 and d1 >= 0 and (l1 >= 0) and (r1 >= 0):
		print('YES')
	else:
		print('NO')

def main():
	test = 1
	test = int(input())
	for _ in range(test):
		solve()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	(n, U, R, D, L) = map(int, input().split())
	val1 = n
	val2 = n
	if U == 0:
		val1 = val1 - 1
	if D == 0:
		val1 = val1 - 1
	if R == 0:
		val2 = val2 - 1
	if L == 0:
		val2 = val2 - 1
	flag = 1
	if U > val2 or D > val2 or L > val1 or (R > val1):
		flag = 0
	elif (U == 1 or D == 1) and R == val1 and (L == val1):
		flag = 0
	elif (R == 1 or L == 1) and U == val2 and (D == val2):
		flag = 0
	elif U == 1 and D == 1 and (R == val1 and L > val1 - 2 or (L == val1 and R > val1 - 2)):
		flag = 0
	elif L == 1 and R == 1 and (U == val2 and D > val2 - 2 or (D == val2 and U > val2 - 2)):
		flag = 0
	if flag == 0:
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	(n, u, r, d, l) = map(int, input().split())
	n1 = n
	u1 = u
	c = 0
	r1 = r
	d1 = d
	l1 = l
	if u <= n - 2:
		c += 1
	elif u == n:
		r1 -= 1
		l1 -= 1
	elif u == n - 1:
		if r1 > l1:
			r1 -= 1
		else:
			l1 -= 1
	if r <= n - 2:
		c += 1
	elif r == n:
		u1 -= 1
		d1 -= 1
	elif r == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	if l <= n - 2:
		c += 1
	elif l == n:
		u1 -= 1
		d1 -= 1
	elif l == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	if d <= n - 2:
		c += 1
	elif d == n:
		r1 -= 1
		l1 -= 1
	elif d == n - 1:
		if r1 > l1:
			r1 -= 1
		else:
			l1 -= 1
	if u1 >= 0 and r1 >= 0 and (d1 >= 0) and (l1 >= 0):
		print('YES')
	else:
		print('NO')


def main():
	t = int(input())
	result = []
	for _ in range(t):
		(n, u, r, d, l) = map(int, input().split())
		cnt = [0, 0, 0, 0]
		params = [u, r, d, l]
		correct = True
		for i in range(4):
			val = params[i]
			if val < n - 1:
				continue
			next_ix = (i + 1) % 4
			prev_ix = (i + 4 - 1) % 4
			next_val = params[next_ix]
			prev_val = params[prev_ix]
			if val == n:
				cnt[prev_ix] += 1
				cnt[next_ix] += 1
			if val == n - 1:
				if prev_val < next_val:
					cnt[next_ix] += 1
				else:
					cnt[prev_ix] += 1
			if val < cnt[i]:
				correct = False
				break
		for i in range(4):
			if params[i] < cnt[i]:
				correct = False
				break
		result.append('YES' if correct else 'NO')
	print('\n'.join(result))
main()


t = int(input())
for k in range(t):
	(n, U, R, D, L) = map(int, input().split())
	pr = 0
	for i in range(16):
		m = []
		for j in range(4):
			dd = i >> j & 1
			m.append(dd)
		(ul, ur, dl, dr) = (m[0], m[1], m[2], m[3])
		p1 = 0 <= U - ul - ur <= n - 2
		p2 = 0 <= R - dr - ur <= n - 2
		p3 = 0 <= D - dl - dr <= n - 2
		p4 = 0 <= L - ul - dl <= n - 2
		if p1 and p2 and p3 and p4 and (p1 == True):
			print('YES')
			pr = 1
			break
	if pr == 0:
		print('NO')


for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	(u1, r1, l1, d1) = (u, r, l, d)
	if u == n:
		l1 -= 1
		r1 -= 1
	elif u == n - 1:
		if l1 > r1:
			l1 -= 1
		else:
			r1 -= 1
	if l == n:
		u1 -= 1
		d1 -= 1
	elif l == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	if d == n:
		l1 -= 1
		r1 -= 1
	elif d == n - 1:
		if l1 > r1:
			l1 -= 1
		else:
			r1 -= 1
	if r == n:
		u1 -= 1
		d1 -= 1
	elif r == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	arr = [u1, r1, l1, d1]
	if min(arr) < 0:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(n, u, r, d, l) = [int(i) for i in input().split()]
	(cl, cr, cu, cd) = (0, 0, 0, 0)
	(tl, tr, tu, td) = (0, 0, 0, 0)
	if u == n - 1:
		tl += 1
		tr += 1
	if u == n:
		cl += 1
		cr += 1
	if d == n - 1:
		tl += 1
		tr += 1
	if d == n:
		cl += 1
		cr += 1
	if r == n - 1:
		td += 1
		tu += 1
	if r == n:
		cd += 1
		cu += 1
	if l == n - 1:
		td += 1
		tu += 1
	if l == n:
		cd += 1
		cu += 1
	flag = 0
	if l < cl or r < cr or d < cd or (u < cu):
		flag = 1
		print('NO')
		continue
	l -= cl
	r -= cr
	u -= cu
	d -= cd
	if l + r < tl:
		flag = 1
	if u + d < td:
		flag = 1
	if flag:
		print('NO')
	else:
		print('YES')


def solve(a):
	n = a[0]
	del a[0]
	for tr in range(2):
		for tl in range(2):
			for br in range(2):
				for bl in range(2):
					c = a.copy()
					if tr:
						c[0] -= 1
						c[1] -= 1
					if tl:
						c[0] -= 1
						c[3] -= 1
					if br:
						c[2] -= 1
						c[1] -= 1
					if bl:
						c[2] -= 1
						c[3] -= 1
					if min(c) >= 0 and max(c) <= n - 2:
						return 'Yes'
	return 'No'

def main():
	t = int(input())
	for i in range(t):
		a = list(map(int, input().split(' ')))
		print(solve(a))
main()


for s in [*open(0)][1:]:
	(n, *a) = map(int, s.split())
	f = 0
	for i in range(16):
		b = (*map(int, f'{i:04b}'),)
		f |= all((n - 1 > a[i] - b[i] - b[i - 1] > -1 for i in range(4)))
	print('NYOE S'[f::2])


import sys
input = sys.stdin.readline

def solve():
	(n, U, R, D, L) = map(int, input().split())
	for i in range(2 ** 4):
		(u, r, d, l) = (U, R, D, L)
		if i % 2 == 1:
			u -= 1
			l -= 1
		if i // 2 % 2 == 1:
			u -= 1
			r -= 1
		if i // 4 % 2 == 1:
			d -= 1
			l -= 1
		if i // 8 % 2 == 1:
			d -= 1
			r -= 1
		if u >= 0 and r >= 0 and (d >= 0) and (l >= 0) and (u <= n - 2) and (r <= n - 2) and (d <= n - 2) and (l <= n - 2):
			print('YES')
			return
	print('NO')
for i in range(int(input())):
	solve()


def aje(n, u, r, d, l):
	c1 = 0
	c2 = 0
	c3 = 0
	c4 = 0
	if u + d < r + l - 2 * n + 4 or u + d < max(l, r) - n + 2:
		print('NO')
	elif r + l < u + d - 2 * n + 4 or l + r < max(u, d) - n + 2:
		print('NO')
	elif (u == 0 or d == 0) and (l == n or r == n):
		print('NO')
	elif (l == 0 or r == 0) and (u == n or d == n):
		print('NO')
	elif (u == 1 or d == 1) and (l == n and r == n):
		print('NO')
	elif (l == 1 or r == 1) and (u == n and d == n):
		print('NO')
	else:
		print('YES')
prim = int(input())
while prim > 0:
	a = input().split(' ')
	n = int(a[0])
	u = int(a[1])
	r = int(a[2])
	d = int(a[3])
	l = int(a[4])
	aje(n, u, r, d, l)
	prim -= 1


for t in range(int(input())):
	(n, *urdl) = map(int, input().split())
	if max(urdl) > n:
		print('NO')
		continue
	for i in range(4):
		typ = [None, None]
		if urdl[i] > n - 2:
			if urdl[i] - n + 2 == 1:
				typ[1] = 'b'
			else:
				typ = ['b', 'b']
		if urdl[i] < 2:
			if urdl[i] == 1:
				typ[0] = 'w'
			else:
				typ = ['w', 'w']
		urdl[i] = typ
	f = 0
	for i in range(16):
		rev = bin(i)[2:]
		rev = '0' * (4 - len(rev)) + rev
		urdl_cpy = urdl.copy()
		for j in range(4):
			if rev[j] == '1':
				urdl_cpy[j] = list(reversed(urdl_cpy[j]))
		flags = [0, 0, 0, 0]
		for j in range(4):
			f1 = 0
			f2 = 0
			if urdl_cpy[j][0] is None or urdl_cpy[j - 1][1] is None:
				f1 = 1
			elif urdl_cpy[j][0] == urdl_cpy[j - 1][1]:
				f1 = 1
			if urdl_cpy[j][1] is None or urdl_cpy[(j + 1) % 4][0] is None:
				f2 = 1
			elif urdl_cpy[j][1] == urdl_cpy[(j + 1) % 4][0]:
				f2 = 1
			if f1 and f2:
				flags[j] = 1
		if sum(flags) == 4:
			break
	if sum(flags) == 4:
		print('YES')
	else:
		print('NO')


import os
import sys
import math
from io import BytesIO, IOBase
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def ncr(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def npr(n, r):
	return math.factorial(n) // math.factorial(n - r)

def seive(n):
	primes = [True] * (n + 1)
	ans = []
	for i in range(2, n):
		if not primes[i]:
			continue
		j = 2 * i
		while j <= n:
			primes[j] = False
			j += i
	for p in range(2, n + 1):
		if primes[p]:
			ans += [p]
	return ans

def factors(n):
	factors = []
	x = 1
	while x * x <= n:
		if n % x == 0:
			if n // x == x:
				factors.append(x)
			else:
				factors.append(x)
				factors.append(n // x)
		x += 1
	return factors

def main():
	try:
		for _ in range(inp()):
			(n, u, r, d, l) = invr()
			mnv = mnh = 0
			if u >= n - 1:
				mnh += u - n + 2
			if r >= n - 1:
				mnv += r - n + 2
			if l >= n - 1:
				mnv += l - n + 2
			if d >= n - 1:
				mnh += d - n + 2
			if u + d < mnv:
				print('NO')
				continue
			if r + l < mnh:
				print('NO')
				continue
			if (u == n or d == n) and (r == 0 or l == 0):
				print('NO')
				continue
			if (l == n or r == n) and (u == 0 or d == 0):
				print('NO')
				continue
			if (u == n and d == n) and (r == 1 or l == 1):
				print('NO')
				continue
			if (l == n and r == n) and (u == 1 or d == 1):
				print('NO')
				continue
			print('YES')
			continue
	except Exception as e:
		print(e)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	ans = False
	for tl in range(2):
		for tr in range(2):
			for br in range(2):
				for bl in range(2):
					if 0 <= u - tl - tr <= n - 2 and 0 <= r - tr - br <= n - 2 and (0 <= d - br - bl <= n - 2) and (0 <= l - tl - bl <= n - 2):
						ans = True
	print('YES' if ans else 'NO')


def question2():
	(n, u, r, d, l) = map(int, input().split())
	flag = False
	for c1 in range(2):
		for c2 in range(2):
			for c3 in range(2):
				for c4 in range(2):
					if 0 <= u - c1 - c2 <= n - 2 and 0 <= r - c2 - c3 <= n - 2 and (0 <= d - c3 - c4 <= n - 2) and (0 <= l - c4 - c1 <= n - 2):
						return True
	return False
remained_test_cases = int(input())
while remained_test_cases > 0:
	if question2():
		print('YES')
	else:
		print('NO')
	remained_test_cases = remained_test_cases - 1


def generate_requirements(n, sides):
	if not sides:
		return [{}]
	(count, name, side_a, side_b) = sides[0]
	if count == n:
		req = [{name + side_a: True, name + side_b: True}]
	elif count == n - 1 and count == 1:
		req = [{name + side_a: True, name + side_b: False}, {name + side_a: False, name + side_b: True}]
	elif count == n - 1:
		req = [{name + side_a: True}, {name + side_b: True}]
	elif count == 1:
		req = [{name + side_a: False}, {name + side_b: False}]
	elif count == 0:
		req = [{name + side_a: False, name + side_b: False}]
	else:
		req = [{}]
	req = [{''.join(sorted(k)): v for (k, v) in r.items()} for r in req]
	sub_reqs = generate_requirements(n, sides[1:])
	full_reqs = []
	for r in req:
		for r_sub in sub_reqs:
			joined = dict(r)
			matched = True
			for (k, v) in r_sub.items():
				if k in joined and joined[k] != v:
					matched = False
					break
				joined[k] = v
			if matched:
				full_reqs.append(joined)
	return full_reqs
num_problems = int(input())
for _ in range(num_problems):
	(n, U, R, D, L) = [int(s) for s in input().split()]
	found = False
	for req in generate_requirements(n, [(U, 'U', 'L', 'R'), (D, 'D', 'L', 'R'), (R, 'R', 'U', 'D'), (L, 'L', 'U', 'D')]):
		found = True
		break
	if found:
		print('YES')
	else:
		print('NO')


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
from collections import defaultdict as dd
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
stdmap = lambda : map(int, stdstr().split())
stdarr = lambda : list(map(int, stdstr().split()))
mod = 1000000007
for _ in range(stdint()):
	(n, u, r, d, l) = stdmap()
	l = [u, r, d, l]
	pos = True
	for i in range(4):
		(p, ne) = (l[(i - 1) % 4], l[(i + 1) % 4])
		opp = l[(i + 2) % 4]
		if l[i] == 0:
			if p == n or ne == n:
				pos = False
				break
			elif p == n - 1 and ne == n - 1 and (opp == 1):
				pos = False
				break
			elif (p == n - 1 or ne == n - 1) and opp == 0:
				pos = False
				break
		elif l[i] == 1:
			if p == n and ne == n:
				pos = False
				break
			elif (p == n or ne == n) and (p == n - 1 or ne == n - 1) and (opp <= 1):
				pos = False
				break
	if pos:
		print('YES')
	else:
		print('NO')


def solve():
	(n, u, r, d, l) = map(int, input().split())
	for i in range(16):
		ur = i & 1
		dr = bool(i & 1 << 1)
		dl = bool(i & 1 << 2)
		ul = bool(i & 1 << 3)
		uu = u
		rr = r
		dd = d
		ll = l
		uu -= ur + ul
		rr -= ur + dr
		dd -= dr + dl
		ll -= dl + ul
		for side in (uu, rr, dd, ll):
			if side < 0 or side > n - 2:
				break
		else:
			print('YES')
			return
	print('NO')

def main():
	for i in range(int(input())):
		solve()
main()


from __future__ import division, print_function
import os, sys
import math
import collections
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

class my_dictionary(dict):

	def __init__(self):
		self = dict()

	def add(self, key, value):
		self[key] = value

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def sli():
	return list(msi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def factorial(n):
	return 1 if n == 1 or n == 0 else n * factorial(n - 1)

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r))

def binary_search(arr, low, high, x):
	if high >= low:
		mid = (high + low) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return binary_search(arr, low, mid - 1, x)
		else:
			return binary_search(arr, mid + 1, high, x)
	else:
		return -1

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def nCr(n, r):
	return fact(n) / (fact(r) * fact(n - r))

def fact(n):
	res = 1
	for i in range(2, n + 1):
		res = res * i
	return res

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def padded_bin_with_complement(x):
	if x < 0:
		return bin(2 ** 16 - abs(x))[2:].zfill(16)
	else:
		return bin(x)[2:].zfill(16)

def binaryToDecimal(binary):
	binary1 = binary
	(decimal, i, n) = (0, 0, 0)
	while binary != 0:
		dec = binary % 10
		decimal = decimal + dec * pow(2, i)
		binary = binary // 10
		i += 1
	return decimal

def CountFrequency(my_list):
	freq = {}
	for item in my_list:
		if item in freq:
			freq[item] += 1
		else:
			freq[item] = 1
	return freq

def pos(a):
	b = [0] * len(a)
	c = sorted(a)
	for i in range(len(a)):
		for j in range(len(a)):
			if c[j] == a[i]:
				b[i] = j
				break
	return b

def smallestDivisor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			return i
		i += 2
	return n

def commonn(a, b, n):
	c = []
	for i in range(n):
		if a[i] == b[i]:
			c.append('-1')
		else:
			c.append(b[i])
	return c

def find_lcm(num1, num2):
	if num1 > num2:
		num = num1
		den = num2
	else:
		num = num2
		den = num1
	rem = num % den
	while rem != 0:
		num = den
		den = rem
		rem = num % den
	gcd = den
	lcm = int(int(num1 * num2) / int(gcd))
	return lcm

def sumdigit(n):
	n = str(n)
	k = 0
	for i in range(len(n)):
		k += int(n[i])
	return k

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z
import random

def main():
	for _ in range(ii()):
		r1 = 0
		l1 = 0
		f = 0
		u1 = 0
		b1 = 0
		(n, u, r, b, l) = mi()
		k = n - 2
		if u > k:
			if u == n - 1:
				if r - r1 > l - l1:
					r1 += 1
				else:
					l1 += 1
			if u == n:
				r1 += 1
				l1 += 1
		if b > k:
			if b == n - 1:
				if r - r1 > l - l1:
					r1 += 1
				else:
					l1 += 1
			if b == n:
				r1 += 1
				l1 += 1
		if r > k:
			if r == n - 1:
				if u - u1 > b - b1:
					u1 += 1
				else:
					b1 += 1
			if r == n:
				u1 += 1
				b1 += 1
		if l > k:
			if l == n - 1:
				if u - u1 > b - b1:
					u1 += 1
				else:
					b1 += 1
			if l == n:
				u1 += 1
				b1 += 1
		if u1 <= u and b1 <= b and (r1 <= r) and (l1 <= l):
			f = 1
		else:
			f = 0
		if f == 1:
			print('Yes')
		else:
			print('No')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def solution():
	(n, u, r, d, l) = map(int, input().split())
	if max(u, r, d, l) <= n - 2:
		print('YES')
	elif max(u, r, d, l) == n - 1:
		if u == n - 1 and d == n - 1 and (l + r < 2):
			print('NO')
		elif r == n - 1 and l == n - 1 and (u + d < 2):
			print('NO')
		elif (u == n - 1 or d == n - 1) and l + r < 1:
			print('NO')
		elif (l == n - 1 or r == n - 1) and u + d < 1:
			print('NO')
		else:
			print('YES')
	elif u == n and d == n and (l < 2 or r < 2):
		print('NO')
	elif l == n and r == n and (u < 2 or d < 2):
		print('NO')
	elif (u == n and d == n - 1 or (d == n and u == n - 1)) and l + r < 3:
		print('NO')
	elif (r == n and l == n - 1 or (l == n and r == n - 1)) and u + d < 3:
		print('NO')
	elif (u == n or d == n) and (l == 0 or r == 0):
		print('NO')
	elif (l == n or r == n) and (u == 0 or d == 0):
		print('NO')
	else:
		print('YES')
for t in range(int(input())):
	solution()


opts = [0, 1]

def solution(n, UP, RIGHT, DOWN, LEFT):
	UPop = list(filter(lambda x: x > -1, list(range(UP - (n - 2), min(UP, 2) + 1))))
	RIGHTop = list(filter(lambda x: x > -1, list(range(RIGHT - (n - 2), min(RIGHT, 2) + 1))))
	DOWNop = list(filter(lambda x: x > -1, list(range(DOWN - (n - 2), min(DOWN, 2) + 1))))
	LEFTop = list(filter(lambda x: x > -1, list(range(LEFT - (n - 2), min(LEFT, 2) + 1))))
	for q1 in opts:
		for q2 in opts:
			for q3 in opts:
				for q4 in opts:
					if q1 + q2 in UPop:
						if q2 + q4 in RIGHTop:
							if q3 + q4 in DOWNop:
								if q1 + q3 in LEFTop:
									return 'YES'
	return 'NO'
for t in range(int(input())):
	(n, UP, RIGHT, DOWN, LEFT) = map(int, input().split())
	print(solution(n, UP, RIGHT, DOWN, LEFT))


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	(N, U, R, D, L) = map(int, sys.stdin.readline().split())
	if max(U, R, D, L) <= N - 2:
		print('YES')
	elif max(U, R, D, L) == N - 1:
		if (U == N - 1 and D == N - 1) and L + R < 2:
			print('NO')
		elif (R == N - 1 and L == N - 1) and U + D < 2:
			print('NO')
		elif (U == N - 1 or D == N - 1) and L + R < 1:
			print('NO')
		elif (L == N - 1 or R == N - 1) and U + D < 1:
			print('NO')
		else:
			print('YES')
	elif (U == N and D == N) and (L < 2 or R < 2):
		print('NO')
	elif (L == N and R == N) and (U < 2 or D < 2):
		print('NO')
	elif (U == N and D == N - 1 or (U == N - 1 and D == N)) and L + R < 3:
		print('NO')
	elif (L == N and R == N - 1 or (L == N - 1 and R == N)) and U + D < 3:
		print('NO')
	elif (U == N or D == N) and (L == 0 or R == 0):
		print('NO')
	elif (L == N or R == N) and (U == 0 or D == 0):
		print('NO')
	else:
		print('YES')


T = int(input())
for _ in range(T):
	(N, U, R, D, L) = map(int, input().split())
	flag = False
	for u in range(2):
		for r in range(2):
			for d in range(2):
				for l in range(2):
					u1 = U - u - r
					r1 = R - r - d
					l1 = L - u - l
					d1 = D - l - d
					if min(u1, r1, l1, d1) >= 0 and max(u1, r1, d1, l1) <= N - 2:
						flag = True
						break
	if flag:
		print('YES')
	else:
		print('NO')


import sys
from sys import stdin
tt = int(stdin.readline())
ANS = []
for loop in range(tt):
	(n, U, R, D, L) = map(int, stdin.readline().split())
	ans = 'NO'
	for a in range(2):
		for b in range(2):
			for c in range(2):
				for d in range(2):
					nu = U - a - b
					nr = R - b - c
					nd = D - c - d
					nl = L - a - d
					if max(nu, nr, nd, nl) <= n - 2 and min(nu, nr, nd, nl) >= 0:
						ans = 'YES'
	ANS.append(ans)
print('\n'.join(ANS))


def abc(n, u, r, d, l):
	for i in range(2):
		for j in range(2):
			for k in range(2):
				for p in range(2):
					(x, y, z, b) = (u, r, d, l)
					if i:
						x -= 1
						b -= 1
					if j:
						x -= 1
						y -= 1
					if k:
						y -= 1
						z -= 1
					if p:
						z -= 1
						b -= 1
					if x >= 0 and x <= n - 2 and (y >= 0) and (y <= n - 2) and (z >= 0) and (z <= n - 2) and (b >= 0) and (b <= n - 2):
						return 'YES'
	return 'NO'
t = int(input())
for _ in range(t):
	(n, u, r, d, l) = map(int, input().split())
	print(abc(n, u, r, d, l))


t = int(input())
while t > 0:
	(n, u, r, d, l) = map(int, input().split())
	(u1, r1, d1, l1) = (u, r, d, l)
	if u == n:
		r1 -= 1
		l1 -= 1
	if r == n:
		u1 -= 1
		d1 -= 1
	if d == n:
		r1 -= 1
		l1 -= 1
	if l == n:
		d1 -= 1
		u1 -= 1
	if u == n - 1:
		if l1 > r1:
			l1 -= 1
		else:
			r1 -= 1
	if r == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	if d == n - 1:
		if l1 > r1:
			l1 -= 1
		else:
			r1 -= 1
	if l == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	if u1 < 0 or r1 < 0 or d1 < 0 or (l1 < 0):
		print('NO')
	else:
		print('YES')
	t = t - 1


import sys
zz = 1
sys.setrecursionlimit(10 ** 5)
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def ii():
	return input().rstrip()

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def dadd(d, p, val):
	if p in d:
		d[p].append(val)
	else:
		d[p] = [val]

def gi():
	return [xx for xx in input().split()]

def gtc(tc, ans):
	print('Case #' + str(tc) + ':', ans)

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def prec(a, pre):
	for i in a:
		pre.append(pre[-1] + i)
	pre.pop(0)

def YN(flag):
	print('YES' if flag else 'NO')

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def isvalid(i, j, n, m):
	return 0 <= i < n and 0 <= j < m

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()
INF = 10 ** 18
uu = t
while t > 0:
	t -= 1
	(n, u, r, d, l) = mi()
	(nu, nr, nd, nl) = (u, r, d, l)
	if u == n:
		nl -= 1
		nr -= 1
	elif u == n - 1:
		if nl > nr:
			nl -= 1
		else:
			nr -= 1
	if d == n:
		nl -= 1
		nr -= 1
	elif d == n - 1:
		if nl > nr:
			nl -= 1
		else:
			nr -= 1
	if l == n:
		nu -= 1
		nd -= 1
	elif l == n - 1:
		if nu > nd:
			nu -= 1
		else:
			nd -= 1
	if r == n:
		nu -= 1
		nd -= 1
	elif r == n - 1:
		if nu > nd:
			nu -= 1
		else:
			nd -= 1
	print('YES' if min(nl, nr) >= 0 and min(nu, nd) >= 0 else 'NO')


def solution(n, u, r, d, l):
	maxfilled = u + r + d + l
	minfilled = u + r + d + l - 4
	found = False
	for i in range(16):
		(ur, rd, dl, lu) = (int(x) for x in bin(i)[2:].zfill(4))
		n2 = n - 2
		if u - ur - lu <= n2 and r - ur - rd <= n2 and (d - rd - dl <= n2) and (l - dl - lu <= n2) and (u - ur - lu >= 0) and (r - ur - rd >= 0) and (d - rd - dl >= 0) and (l - dl - lu >= 0):
			found = True
			break
	if found:
		print('YES')
	else:
		print('NO')

def main():
	for _ in range(int(input())):
		solution(*map(int, input().split()))
main()


t = int(input())
for _ in range(t):
	(n, u, r, d, l) = [int(i) for i in input().split()]
	if u == 0 and r == 0 and (d == 0) and (l == 0):
		print('YES')
	else:
		l1 = l
		r1 = r
		if u > n - 2:
			if u == n - 1:
				if l > r:
					l -= 1
				else:
					r -= 1
			else:
				l -= 1
				r -= 1
		if d > n - 2:
			if d == n - 1:
				if l > r:
					l -= 1
				else:
					r -= 1
			else:
				l -= 1
				r -= 1
		count_l = 0
		if l1 > n - 2:
			if l1 == n - 1:
				if u > d:
					u -= 1
				else:
					d -= 1
			else:
				u -= 1
				d -= 1
		if r1 > n - 2:
			if r1 == n - 1:
				if u > d:
					u -= 1
				else:
					d -= 1
			else:
				u -= 1
				d -= 1
		if u < 0 or d < 0 or l < 0 or (r < 0):
			print('NO')
		else:
			print('YES')


t = int(input())

def bracketable(s):
	if s[0] == ')' or s[-1] == '(':
		return False
	if s.count('(') != s.count(')'):
		return False
	return True
for _ in range(t):
	[n, U, R, D, L] = list(map(int, input().split()))
	u = r = d = l = u_ = r_ = d_ = l_ = 0
	if U == n:
		r += 1
		l += 1
		u_ = 2
	if U == n - 1:
		u_ = 1
	if R == n:
		u += 1
		d += 1
		r_ = 2
	if R == n - 1:
		r_ = 1
	if D == n:
		r += 1
		l += 1
		d_ = 2
	if D == n - 1:
		d_ = 1
	if L == n:
		u += 1
		d += 1
		l_ = 2
	if L == n - 1:
		l_ = 1
	if u > U or r > R or d > D or (l > L) or (u_ + d_ > R + L) or (r_ + l_ > U + D):
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	(x1, x2, x3, x4) = (0, 0, 0, 0)
	if u == n:
		(x1, x2) = (1, 1)
	if r == n:
		(x3, x2) = (1, 1)
	if d == n:
		(x3, x4) = (1, 1)
	if l == n:
		(x1, x4) = (1, 1)
	ans = 'YES'
	if u < x1 + x2:
		ans = 'NO'
	if r < x3 + x2:
		ans = 'NO'
	if d < x3 + x4:
		ans = 'NO'
	if l < x1 + x4:
		ans = 'NO'
	if u >= n - 2 or d >= n - 2:
		cr = max(0, u - (n - 2))
		cr += max(0, d - (n - 2))
		if l + r < cr:
			ans = 'NO'
	if l >= n - 2 or r >= n - 2:
		cr = max(0, l - (n - 2))
		cr += max(0, r - (n - 2))
		if u + d < cr:
			ans = 'NO'
	print(ans)


for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	for i in range(1 << 5):
		if u < (i & 1 << 3 > 0) + (i & 1 << 2 > 0) or n - 2 < u - (i & 1 << 3 > 0) - (i & 1 << 2 > 0):
			continue
		if r < (i & 1 << 2 > 0) + (i & 1 << 1 > 0) or n - 2 < r - (i & 1 << 2 > 0) - (i & 1 << 1 > 0):
			continue
		if d < (i & 1 << 1 > 0) + (i & 1 << 0 > 0) or n - 2 < d - (i & 1 << 1 > 0) - (i & 1 << 0 > 0):
			continue
		if l < (i & 1 << 0 > 0) + (i & 1 << 3 > 0) or n - 2 < l - (i & 1 << 0 > 0) - (i & 1 << 3 > 0):
			continue
		print('YES')
		break
	else:
		print('NO')


def allowable(n, u, r, d, l):
	cond_u = 0
	cond_r = 0
	cond_d = 0
	cond_l = 0
	cond_lr = 0
	cond_ud = 0
	if r == n:
		cond_u += 1
		cond_d += 1
		cond_ud += 2
	if l == n:
		cond_u += 1
		cond_d += 1
		cond_ud += 2
	if u == n:
		cond_r += 1
		cond_l += 1
		cond_lr += 2
	if d == n:
		cond_r += 1
		cond_l += 1
		cond_lr += 2
	if r == n - 1:
		cond_ud += 1
	if l == n - 1:
		cond_ud += 1
	if u == n - 1:
		cond_lr += 1
	if d == n - 1:
		cond_lr += 1
	return cond_u <= u and cond_r <= r and (cond_d <= d) and (cond_l <= l) and (cond_ud <= u + d) and (cond_lr <= l + r)
i = input()
while True:
	try:
		i = input()
		(n, u, r, d, l) = [int(x) for x in i.split()]
		if allowable(n, u, r, d, l):
			print('YES')
		else:
			print('NO')
	except EOFError:
		break


def gen_case():
	l = [0, 0, 0, 0, 0]
	while l[4] == 0:
		l[0] += 1
		for i in range(len(l) - 1):
			l[i + 1] += l[i] // 2
			l[i] %= 2
		yield {key: elem for (key, elem) in zip(['UL', 'UR', 'DR', 'DL'], l[0:4])}
	return

def check(case, n, u, r, d, l):
	if case['UL'] == 1:
		u -= 1
		l -= 1
	if case['UR'] == 1:
		u -= 1
		r -= 1
	if case['DR'] == 1:
		d -= 1
		r -= 1
	if case['DL'] == 1:
		d -= 1
		l -= 1
	n -= 2
	for elem in (u, r, d, l):
		if elem < 0 or elem > n:
			return False
	return True

def solve():
	for _ in range(int(input())):
		(n, u, r, d, l) = map(int, input().split())
		print({True: 'YES', False: 'NO'}[True in [check(case, n, u, r, d, l) for case in gen_case()]])
solve()


n = int(input())
a = []
b = []
c = []
for i in range(n):
	m1 = 0
	m2 = 0
	kontrol2 = ''
	a = list(map(int, input().split()))
	z = a[0]
	b = list(map(lambda x: z - x - 2 if z - x <= 2 else 0, a[1:5]))
	c = list(map(lambda x: 2 if x > 2 else x, a[1:5]))
	c.append(c[0])
	c.append(c[3])
	for i in range(4):
		if b[i] == -2:
			if c[i - 1] == 0 or c[i + 1] == 0:
				kontrol2 = 'BLIA'
		if i % 2 == 0:
			m2 += c[i]
			m1 += b[i]
		else:
			m1 += c[i]
			m2 += b[i]
	if m1 < 0 or m2 < 0 or kontrol2 == 'BLIA':
		print('No')
	else:
		print('Yes')


from sys import stdin
input = stdin.readline

def solve(i, j, k):
	ans = 0
	ll = {'A': i, 'B': j, 'C': k}
	for i in s:
		ans += ll[i]
		if ans < 0:
			return False
	return True if ans == 0 else False
for _ in range(int(input())):
	(n, a, b, c, d) = map(int, input().split())
	f = 0
	for i in range(16):
		(u, r, dd, l) = (a, b, c, d)
		if i & 1 != 0:
			u -= 1
			l -= 1
		if i & 2 != 0:
			u -= 1
			r -= 1
		if i & 4 != 0:
			dd -= 1
			r -= 1
		if i & 8 != 0:
			l -= 1
			dd -= 1
		if min(u, l, r, dd) >= 0 and max(u, l, r, dd) <= n - 2:
			print('YES')
			f = 1
			break
	if f == 0:
		print('NO')


for s in [*open(0)][1:]:
	(n, *a) = map(int, s.split())
	print('NYOE S'[any((all((n > a[j] - (i >> j & 1) - (i >> j + 1 & 1) + 1 > 0 for j in range(4))) for i in range(0, 272, 17)))::2])


def bon(n, a, b, c, d):
	if min(min(a, b), min(c, d)) < 0:
		return False
	if max(max(a, b), max(c, d)) > n - 2:
		return False
	return True

def ok(n, u, r, e, l):
	for w in range(2):
		for x in range(2):
			for y in range(2):
				for z in range(2):
					a = u - w - z
					b = l - x - w
					c = e - y - x
					d = r - z - y
					if bon(n, a, b, c, d):
						return True
	return False
t = int(input())
for _ in range(t):
	(n, u, r, e, l) = map(int, input().split())
	if ok(n, u, r, e, l):
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	(n, u, r, d, l) = map(int, input().split())
	t -= 1
	f = 0
	if u == 0:
		if l == n or r == n:
			f = 1
		if l == n - 1 and r == n - 1 and (d < 2):
			f = 1
		if (l == n - 1 or r == n - 1) and d == 0:
			f = 1
	if u == 1:
		if l == n and r == n:
			f = 1
		if l == n - 1 and r == n - 1 and (d == 0):
			f = 1
		if l == n and r == n - 1 and (d < 2):
			f = 1
		if r == n and l == n - 1 and (d < 2):
			f = 1
	if d == 0:
		if l == n or r == n:
			f = 1
		if l == n - 1 and r == n - 1 and (u < 2):
			f = 1
		if (l == n - 1 or r == n - 1) and u == 0:
			f = 1
	if d == 1:
		if l == n and r == n:
			f = 1
		if l == n - 1 and r == n - 1 and (u == 0):
			f = 1
		if l == n and r == n - 1 and (u < 2):
			f = 1
		if r == n and l == n - 1 and (u < 2):
			f = 1
	if l == 0:
		if u == n or d == n:
			f = 1
		if u == n - 1 and d == n - 1 and (r < 2):
			f = 1
		if (u == n - 1 or d == n - 1) and r == 0:
			f = 1
	if l == 1:
		if u == n and d == n:
			f = 1
		if u == n - 1 and d == n - 1 and (r == 0):
			f = 1
		if u == n and d == n - 1 and (r < 2):
			f = 1
		if d == n and u == n - 1 and (r < 2):
			f = 1
	if r == 0:
		if u == n or d == n:
			f = 1
		if u == n - 1 and d == n - 1 and (l < 2):
			f = 1
		if (u == n - 1 or d == n - 1) and l == 0:
			f = 1
	if r == 1:
		if u == n and d == n:
			f = 1
		if u == n - 1 and d == n - 1 and (l == 0):
			f = 1
		if u == n and d == n - 1 and (l < 2):
			f = 1
		if d == n and u == n - 1 and (l < 2):
			f = 1
	if f == 0:
		print('YES')
	else:
		print('NO')


import sys
t = int(input())
for i in range(t):
	(n, u, r, d, l) = map(int, sys.stdin.readline().rstrip().split())
	l_must = 0
	r_must = 0
	u_must = 0
	d_must = 0
	must = 0
	if n - u < 2:
		if n - u == 0:
			must += 2
			l_must += 1
			r_must += 1
		else:
			must += 1
	if n - d < 2:
		if n - d == 0:
			l_must += 1
			r_must += 1
			must += 2
		else:
			must += 1
	if r + l < must:
		print('NO')
		continue
	elif l < l_must or r < r_must:
		print('NO')
		continue
	must = 0
	if n - r < 2:
		if n - r == 0:
			must += 2
			u_must += 1
			d_must += 1
		else:
			must += 1
	if n - l < 2:
		if n - l == 0:
			must += 2
			u_must += 1
			d_must += 1
		else:
			must += 1
	if u + d < must:
		print('NO')
		continue
	elif u < u_must or d < d_must:
		print('NO')
		continue
	print('YES')


for t in range(int(input())):
	(n, U, R, D, L) = [int(x) for x in input().split()]
	flag = True
	if U == n and D == n:
		if L < 2 or R < 2:
			flag = False
	elif U == n - 1 and D == n:
		if L == 0 or R == 0 or (L < 2 and R < 2):
			flag = False
	elif U == n and D == n - 1:
		if L == 0 or R == 0 or (L < 2 and R < 2):
			flag = False
	elif U == n - 1 and D == n - 1:
		if L + R < 2:
			flag = False
	elif U == n or D == n:
		if L == 0 or R == 0:
			flag = False
	elif U == n - 1 or D == n - 1:
		if L == 0 and R == 0:
			flag = False
	if L == n and R == n:
		if U < 2 or D < 2:
			flag = False
	elif L == n - 1 and R == n:
		if U == 0 or D == 0 or (U < 2 and D < 2):
			flag = False
	elif L == n and R == n - 1:
		if U == 0 or D == 0 or (U < 2 and D < 2):
			flag = False
	elif L == n - 1 and R == n - 1:
		if U + D < 2:
			flag = False
	elif L == n or R == n:
		if U == 0 or D == 0:
			flag = False
	elif L == n - 1 or R == n - 1:
		if U == 0 and D == 0:
			flag = False
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, u, r, d, l) = list(map(int, input().split()))
	sides = [u, r, d, l]
	used = [[], [], [], []]
	for i in range(4):
		if sides[i] == n - 1:
			sides[i] -= 1
			if i - 4 in used[i - 1]:
				sides[i - 3] -= 1
				used[i].append(i - 3)
				used[i - 3].append(i)
			elif i - 4 in used[i - 3]:
				sides[i - 1] -= 1
				used[i].append(i - 1)
				used[i - 1].append(i)
			elif sides[i - 3] > sides[i - 1]:
				sides[i - 3] -= 1
				used[i].append(i - 3)
			else:
				sides[i - 1] -= 1
				used[i].append(i - 1)
		elif sides[i] == n:
			sides[i] -= 2
			sides[i - 3] -= 1
			sides[i - 1] -= 1
			used[i].append(i - 3)
			used[i].append(i - 1)
			used[i - 3].append(i)
			used[i - 1].append(i)
	if min(sides) < 0 or max(sides) > n - 2:
		print('NO')
	else:
		print('YES')


def chk(l):
	for i in l:
		if i < 0:
			return 0
	return 1
for _ in range(int(input())):
	(n, up, rgt, dwn, lft) = map(int, input().split())
	edge = [up, rgt, dwn, lft]
	if up == n:
		edge[1] -= 1
		edge[3] -= 1
	elif up == n - 1:
		if rgt > lft:
			edge[1] -= 1
		else:
			edge[3] -= 1
	if not chk(edge):
		print('No')
		continue
	if rgt == n:
		edge[0] -= 1
		edge[2] -= 1
	elif rgt == n - 1:
		if edge[0] < edge[2]:
			edge[2] -= 1
		else:
			edge[0] -= 1
	if not chk(edge):
		print('No')
		continue
	if dwn == n:
		edge[1] -= 1
		edge[3] -= 1
	elif dwn == n - 1:
		if edge[1] < edge[3]:
			edge[3] -= 1
		else:
			edge[1] -= 1
	if not chk(edge):
		print('No')
		continue
	if lft == n:
		edge[2] -= 1
		edge[0] -= 1
	elif lft == n - 1:
		if edge[0] < edge[2]:
			edge[2] -= 1
		else:
			edge[0] -= 1
	if not chk(edge):
		print('No')
		continue
	print('Yes')


for _ in range(int(input())):
	(n, u, r, d, l) = tuple(map(int, input().split()))
	if u <= n and d <= n and (r <= n) and (l <= n):
		s = 0
		if r == n and l == n and (u > 1 and d > 1):
			s += 1
		elif (r == n and l == n - 1 or (r == n - 1 and l == n)) and (u > 1 and d > 0 or (u > 0 and d > 1)):
			s += 1
		elif r == n - 1 and l == n - 1 and (u > 0 and d > 0 or u > 1 or d > 1):
			s += 1
		elif (r == n and l <= n - 2 or (r <= n - 2 and l == n)) and (u > 0 and d > 0):
			s += 1
		elif (r == n - 1 and l <= n - 2 or (r <= n - 2 and l == n - 1)) and (u > 0 or d > 0):
			s += 1
		elif l <= n - 2 and r <= n - 2:
			s += 1
		(u, d, r, l) = (r, l, u, d)
		if r == n and l == n and (u > 1 and d > 1):
			s += 1
		elif (r == n and l == n - 1 or (r == n - 1 and l == n)) and (u > 1 and d > 0 or (u > 0 and d > 1)):
			s += 1
		elif r == n - 1 and l == n - 1 and (u > 0 and d > 0 or u > 1 or d > 1):
			s += 1
		elif (r == n and l <= n - 2 or (r <= n - 2 and l == n)) and (u > 0 and d > 0):
			s += 1
		elif (r == n - 1 and l <= n - 2 or (r <= n - 2 and l == n - 1)) and (u > 0 or d > 0):
			s += 1
		elif l <= n - 2 and r <= n - 2:
			s += 1
		if s == 2:
			print('Yes')
		else:
			print('No')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(n, U, R, D, L) = map(int, input().split())
	u = U
	r = R
	d = D
	l = L
	f = 1
	if u == n:
		l -= 1
		r -= 1
	elif u == n - 1:
		if r > l:
			r -= 1
		else:
			l -= 1
	if d == n:
		l -= 1
		r -= 1
	elif d == n - 1:
		if r > l:
			r -= 1
		else:
			l -= 1
	if r < 0 or l < 0:
		f = 0
	if f:
		if L == n:
			U -= 1
			D -= 1
		elif L == n - 1:
			if U > D:
				U -= 1
			else:
				D -= 1
		if R == n:
			U -= 1
			D -= 1
		elif R == n - 1:
			if U > D:
				U -= 1
			else:
				D -= 1
		if D < 0 or U < 0:
			f = 0
	if f:
		print('YES')
	else:
		print('NO')


def grtid(n, U, R, D, L):
	for i in range(16):
		(nu, nr, nd, nl) = (U, R, D, L)
		if i & 1:
			nu -= 1
			nr -= 1
		if i & 2:
			nu -= 1
			nl -= 1
		if i & 4:
			nd -= 1
			nl -= 1
		if i & 8:
			nd -= 1
			nr -= 1
		if min(nd, nr, nl, nu) >= 0 and max(nd, nr, nl, nu) <= n - 2:
			return 'YES'
	return 'NO'
for i in range(int(input())):
	(a, b, c, d, e) = map(int, input().strip().split())
	print(grtid(a, b, c, d, e))


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class SegmentTree:

	def __init__(self, data, default=-10 ** 6, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree1:

	def __init__(self, data, default=10 ** 6, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
MOD = 10 ** 9 + 7

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 10 ** 9 + 7
omod = 998244353
prime = [True for i in range(200001)]
pp = [0] * 200001

def SieveOfEratosthenes(n=200000):
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1

def check(n, u, r, d, l):
	(c1, c2, c3, c4) = (0, 0, 0, 0)
	if u == n:
		r -= 1
		l -= 1
		u -= 2
		(c1, c2) = (1, 1)
	elif u == n - 1:
		m = max(l, r)
		if r == m:
			r -= 1
			c2 = 1
		else:
			l -= 1
			c1 = 1
		u -= 1
	if r == n:
		u -= 1
		d -= 1
		(c2, c3) = (1, 1)
		r -= 2
	elif r == n - 1:
		m = max(u, d)
		if u == m:
			if c2 == 1:
				d -= 1
				c3 = 1
			else:
				u -= 1
				c2 = 1
		else:
			d -= 1
			c3 = 1
		r -= 1
	if d == n:
		r -= 1
		l -= 1
		(c3, c4) = (1, 1)
		d -= 2
	elif d == n - 1:
		m = max(l, r)
		if r == m:
			if c3 == 1:
				c4 = 1
				l -= 1
			else:
				c3 = 1
				r -= 1
		else:
			l -= 1
			c4 = 1
		d -= 1
	if l == n:
		u -= 1
		d -= 1
		(c4, c1) = (1, 1)
		l -= 2
	elif l == n - 1:
		m = max(u, d)
		if m == u:
			if c1 == 1:
				c4 = 1
				d -= 1
			else:
				c1 = 1
				u -= 1
		elif c4 == 1:
			c1 = 1
			u -= 1
		else:
			c4 = 1
			d -= 1
		l -= 1
	if min(l, r, d, u) < 0:
		return 0
	return 1
for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	ch = check(n, u, r, d, l)
	if ch:
		print('YES')
	else:
		print('NO')


def readints():
	return map(int, input().split())

def readint():
	return int(input())
t = readint()
for _ in range(t):
	(n, u, r, d, l) = readints()
	poss = False
	for co1 in (0, 1):
		for co2 in (0, 1):
			for co3 in (0, 1):
				for co4 in (0, 1):
					if u - co1 - co2 in range(0, n - 1) and r - co2 - co3 in range(0, n - 1) and (d - co3 - co4 in range(0, n - 1)) and (l - co4 - co1 in range(0, n - 1)):
						poss = True
	if poss:
		print('YES')
	else:
		print('NO')


t = int(input())
arrays = []
for _ in range(t):
	array = [int(x) for x in input().split()]
	arrays.append(array)

def test(m, M, c):
	n = len(m)
	for i in range(n):
		if c[i] + c[(i - 1) % n] > M[i]:
			return False
		if c[i] + c[(i - 1) % n] < m[i]:
			return False
	return True

def test_from_position(m, M, c, pos):
	c = c[:]
	if m[pos] == 2:
		possibilities = [1]
	elif M[pos] == 0:
		possibilities = [0]
	else:
		possibilities = [0, 1]
	for possibility in possibilities:
		c[pos] = possibility
		if pos == len(m) - 1:
			if test(m, M, c):
				return True
		elif test_from_position(m, M, c, pos + 1):
			return True
	return False

def test_array(array):
	(n, U, R, B, L) = array
	m = [max(2 - (array[0] - array[i]), 0) for i in range(1, len(array))]
	M = [min(array[i], 2) for i in range(1, len(array))]
	c = [0, 0, 0, 0]
	return test_from_position(m, M, c, 0)
for array in arrays:
	res = test_array(array)
	if res:
		print('YES')
	else:
		print('NO')


def f(state, side):
	i = side * 2
	l = board[side]
	a = state[i]
	b = state[(i + 1) % 8]
	c = state[(i + 2) % 8]
	if c == -1:
		comb = [[a, l - a, 0], [a, l - a - 1, 1]]
	else:
		comb = [[a, l - a - c, c]]
	for x in comb:
		[a, b, c] = x
		if b > n - 2:
			continue
		if a < 0 or b < 0 or c < 0:
			continue
		if side == 3:
			return True
		state[i] = a
		state[(i + 1) % 8] = b
		state[(i + 2) % 8] = c
		r = f(state.copy(), side + 1)
		if r:
			return True
	return False
for _ in range(int(input())):
	(n, u, r, d, l) = [int(x) for x in input().split()]
	board = [u, r, d, l]
	for corner in [0, 1]:
		state = [-1] * 8
		state[0] = corner
		r = f(state, 0)
		if r:
			break
	if r:
		print('YES')
	else:
		print('NO')


f = lambda x, n: x - n + 2 if x - n + 2 > 0 else 0
for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	n_u = f(u, n)
	n_r = f(r, n)
	n_d = f(d, n)
	n_l = f(l, n)
	ud = n_u + n_d
	ud2 = 2 if u == n and d == n else 1 if u == n or d == n else 0
	rl = n_r + n_l
	rl2 = 2 if r == n and l == n else 1 if r == n or l == n else 0
	if r >= ud2 and l >= ud2 and (u >= rl2) and (d >= rl2):
		if r + l >= ud and u + d >= rl:
			print('YES')
			continue
	print('NO')


import sys
t = int(input())
for _t in range(t):
	(n, u, r, d, l) = map(int, sys.stdin.readline().split())
	a = (u, r, d, l)
	for i in range(4):
		if a[i] == n:
			if a[(i + 1) % 4] == 0 or a[(i - 1) % 4] == 0:
				print('NO')
				break
			if a[(i + 2) % 4] == n:
				if a[(i + 1) % 4] < 2 or a[(i - 1) % 4] < 2:
					print('NO')
					break
			elif a[(i + 2) % 4] == n - 1:
				if a[(i + 1) % 4] + a[(i - 1) % 4] < 3:
					print('NO')
					break
		elif a[i] == n - 1:
			if a[(i + 1) % 4] == 0 and a[(i - 1) % 4] == 0:
				print('NO')
				break
			if a[(i + 2) % 4] == n - 1:
				if a[(i + 1) % 4] == 0 and a[(i - 1) % 4] < 2 or (a[(i - 1) % 4] == 0 and a[(i + 1) % 4] < 2):
					print('NO')
					break
		elif a[i] == 0 and a[(i + 2) % 4] <= 1:
			if a[(i + 1) % 4] >= n - 1 and a[(i - 1) % 4] >= n - 1:
				print('NO')
				break
	else:
		print('YES')


try:
	t = int(input())
	for i in range(0, t):
		(n, u, r, d, l) = list(map(int, input().split(' ')))
		if u <= n - 2 and r <= n - 2 and (l <= n - 2) and (d <= n - 2):
			print('YES')
		else:
			u1 = u
			r1 = r
			d1 = d
			l1 = l
			if u == n:
				r1 -= 1
				l1 -= 1
			if u == n - 1:
				if r1 >= l1:
					r1 -= 1
				else:
					l1 -= 1
			if d == n:
				r1 -= 1
				l1 -= 1
			if d == n - 1:
				if r1 >= l1:
					r1 -= 1
				else:
					l1 -= 1
			if r == n:
				u1 -= 1
				d1 -= 1
			if r == n - 1:
				if u1 >= d1:
					u1 -= 1
				else:
					d1 -= 1
			if l == n:
				u1 -= 1
				d1 -= 1
			if l == n - 1:
				if u1 >= d1:
					u1 -= 1
				else:
					d1 -= 1
			if u1 < 0 or r1 < 0 or l1 < 0 or (d1 < 0):
				print('NO')
			else:
				print('YES')
except:
	pass


from sys import stdin
input = lambda : stdin.readline().strip()
lin = lambda : list(map(int, input().split()))
iin = lambda : int(input())
main = lambda : map(int, input().split())
from math import ceil, sqrt, factorial, log
from collections import deque
from bisect import bisect_left
mod = 998244353
mod = 1000000007

def gcd(a, b):
	(a, b) = (max(a, b), min(a, b))
	while a % b != 0:
		(a, b) = (b, a % b)
	return b

def moduloinverse(a):
	return pow(a, mod - 2, mod)

def solve1(n, f, i):
	(u, r, d, l) = f
	if i == 'u':
		if f[0] >= 0:
			if 2 <= f[0] <= n and solve1(n, [0, r - 1, d, l - 1], 'r'):
				return 1
			elif 1 <= f[0] <= n - 1 and solve1(n, [0, r - 1, d, l], 'r'):
				return 1
			elif 1 <= f[0] <= n - 1 and solve1(n, [0, r, d, l - 1], 'r'):
				return 1
			elif 0 <= f[0] <= n - 2 and solve1(n, [0, r, d, l], 'r'):
				return 1
			else:
				return 0
		else:
			return 0
	if i == 'r':
		if f[1] >= 0:
			if 1 <= f[1] <= n - 1 and solve1(n, [0, 0, d - 1, l], 'd'):
				return 1
			elif 0 <= f[1] <= n - 2 and solve1(n, [0, 0, d, l], 'd'):
				return 1
			else:
				return 0
		else:
			return 0
	if i == 'd':
		if f[2] >= 0:
			if 1 <= f[2] <= n - 1 and solve1(n, [0, 0, 0, l - 1], 'l'):
				return 1
			elif 0 <= f[2] <= n - 2 and solve1(n, [0, 0, 0, l], 'l'):
				return 1
			else:
				return 0
		else:
			return 0
	if i == 'l':
		if f[3] >= 0:
			if 0 <= f[3] <= n - 2:
				return 1
			else:
				return 0
		else:
			return 0

def solve(we):
	(n, u, r, d, l) = main()
	f = [u, r, d, l]
	x = solve1(n, f, 'u')
	if x:
		print('YES')
	else:
		print('NO')
qwe = 1
qwe = iin()
for _ in range(qwe):
	solve(_ + 1)


for s in [*open(0)][1:]:
	(n, *a) = map(int, s.split())
	i = 16
	f = 0
	while i:
		i -= 1
		f |= all((n - 1 > a[j] - (i >> j & 1) - (i >> (j + 1) % 4 & 1) > -1 for j in range(4)))
	print('NYOE S'[f::2])


for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	for i in range(16):
		(ru, rr, rd, rl) = (u, r, d, l)
		if i & 1:
			ru -= 1
			rl -= 1
		if i & 8:
			ru -= 1
			rr -= 1
		if 4 & i:
			rr -= 1
			rd -= 1
		if 2 & i:
			rd -= 1
			rl -= 1
		if min(ru, rr, rl, rd) >= 0 and max(ru, rr, rl, rd) < n - 1:
			print('YES')
			break
	else:
		print('NO')


for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	ans = 'NO'
	for i in range(2):
		for j in range(2):
			for k in range(2):
				for m in range(2):
					u1 = u - i - m
					r1 = r - i - j
					d1 = d - j - k
					l1 = l - m - k
					if min(u1, r1, d1, l1) >= 0 and max(u1, r1, d1, l1) <= n - 2:
						ans = 'YES'
						break
				if ans == 'YES':
					break
			if ans == 'YES':
				break
		if ans == 'YES':
			break
	print(ans)


for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	arr = [u, r, d, l]
	req = [0, 0, 0, 0]
	for i in range(4):
		if arr[i] == n:
			try:
				req[i - 1] += 1
			except:
				req[3] += 1
			try:
				req[i + 1] += 1
			except:
				req[0] += 1
		elif arr[i] == n - 1:
			if i - 1 < 0:
				left = 3
			else:
				left = i - 1
			if i + 1 > 3:
				right = 0
			else:
				right = i + 1
			if arr[left] >= arr[right]:
				req[left] += 1
			else:
				req[right] += 1
	flag = 0
	for i in range(4):
		if arr[i] < req[i]:
			flag = 1
	if flag == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(n, U, R, D, L) = map(int, input().split())
	for i in range(16):
		(u, r, d, l) = (U, R, D, L)
		if i & 1:
			l -= 1
			u -= 1
		if i & 2:
			u -= 1
			r -= 1
		if i & 4:
			r -= 1
			d -= 1
		if i & 8:
			d -= 1
			l -= 1
		if min(u, r, l, d) >= 0 and max(u, r, d, l) <= n - 2:
			print('YES')
			break
	else:
		print('NO')


import itertools

def solve(arr):
	(n, top, right, bot, left) = arr
	for i in itertools.product([0, 1], repeat=4):
		if 0 <= top - (i[0] + i[1]) <= n - 2 and 0 <= left - (i[0] + i[2]) <= n - 2 and (0 <= right - (i[1] + i[3]) <= n - 2) and (0 <= bot - (i[2] + i[3]) <= n - 2):
			return True
	return False
num_tests = int(input())
for _ in range(num_tests):
	arr = list(map(int, input().split()))
	if solve(arr):
		print('YES')
	else:
		print('NO')


for testcase in range(int(input())):
	arr = [int(x) for x in input().split()]
	(n, u, r, d, l) = (arr[0], arr[1], arr[2], arr[3], arr[4])
	if u < n - 1 and r < n - 1 and (d < n - 1) and (l < n - 1):
		print('YES')
		continue
	(u1, r1, d1, l1) = (u, r, d, l)
	if u == n:
		r1 -= 1
		l1 -= 1
	if d == n:
		r1 -= 1
		l1 -= 1
	if r == n:
		u1 -= 1
		d1 -= 1
	if l == n:
		u1 -= 1
		d1 -= 1
	if u == n - 1:
		if r1 > l1:
			r1 -= 1
		else:
			l1 -= 1
	if d == n - 1:
		if r1 > l1:
			r1 -= 1
		else:
			l1 -= 1
	if r == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	if l == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	if min(u1, r1, d1, l1) < 0:
		print('NO')
	else:
		print('YES')


def solve():
	(n, u, r, d, l) = map(int, input().split())
	for s in range(16):
		(uc, rc, dc, lc) = (u, r, d, l)
		if s & 1:
			lc -= 1
			uc -= 1
		if s & 2:
			uc -= 1
			rc -= 1
		if s & 4:
			rc -= 1
			dc -= 1
		if s & 8:
			lc -= 1
			dc -= 1
		if uc >= 0 and rc >= 0 and (dc >= 0) and (lc >= 0) and (uc <= n - 2) and (rc <= n - 2) and (dc <= n - 2) and (lc <= n - 2):
			return 'YES'
	return 'NO'
for _ in range(int(input())):
	print(solve())


import math, sys
from collections import defaultdict, deque
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')

def I():
	return int(sys.stdin.readline())

def In():
	return map(int, sys.stdin.readline().split())

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

def Pr(x):
	sys.stdout.write(str(x) + '\n')

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gte(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def check(n, u, r, d, l, mask):
	if mask & 1:
		u -= 1
		r -= 1
	if mask & 2:
		u -= 1
		l -= 1
	if mask & 4:
		d -= 1
		r -= 1
	if mask & 8:
		d -= 1
		l -= 1
	return True if min(min(u, r), min(d, l)) >= 0 and max(max(u, r), max(d, l)) <= n - 2 else False

def main():
	try:
		(n, U, R, D, L) = In()
		ok = False
		for mask in range(1 << 16):
			if check(n, U, R, D, L, mask):
				ok = True
				break
		yes() if ok else no()
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


def chk(sm, n, X):
	return sm <= X and sm >= max(0, X - n + 2)
t = int(input())
for tt in range(t):
	(n, U, R, D, L) = map(int, input().split())
	ans = 0
	for a in range(2):
		for b in range(2):
			for c in range(2):
				for d in range(2):
					if chk(a + b, n, U) and chk(b + c, n, R) and chk(c + d, n, D) and chk(d + a, n, L):
						ans = 1
	print('YES' if ans else 'NO')


def adjacent(a):
	if a == 'u':
		return ('l', 'r')
	if a == 'r':
		return ('u', 'd')
	if a == 'd':
		return ('r', 'l')
	if a == 'l':
		return ('d', 'u')

def solve(n, u, r, d, l):
	dic1 = {}
	dic1['u'] = u
	dic1['r'] = r
	dic1['d'] = d
	dic1['l'] = l
	dic = {}
	arr = [[u, 'u'], [r, 'r'], [d, 'd'], [l, 'l']]
	dic['u'] = arr[0]
	dic['r'] = arr[1]
	dic['d'] = arr[2]
	dic['l'] = arr[3]
	arr = sorted(arr)
	while arr:
		a = arr[-1]
		if a[0] < 0:
			return 'NO'
		elif dic1[a[1]] == n:
			(x, y) = adjacent(a[1])
			dic[x][0] -= 1
			dic[y][0] -= 1
			arr.pop()
			arr = sorted(arr)
		elif dic1[a[1]] == n - 1:
			(x, y) = adjacent(a[1])
			if dic[x][0] < dic[y][0]:
				dic[y][0] -= 1
			else:
				dic[x][0] -= 1
			arr.pop()
			arr = sorted(arr)
		else:
			arr.pop()
	return 'YES'
x = int(input())
for _ in range(x):
	A = list(map(int, input().split()))
	print(solve(A[0], A[1], A[2], A[3], A[4]))


t = int(input())
while t:
	t -= 1
	(n, u, r, d, l) = map(int, input().split())
	for i in range(16):
		(nu, nr, nd, nl) = (u, r, d, l)
		if i & 1:
			nu -= 1
			nl -= 1
		if i & 2:
			nu -= 1
			nr -= 1
		if i & 4:
			nd -= 1
			nl -= 1
		if i & 8:
			nd -= 1
			nr -= 1
		if min(nu, nr, nd, nl) >= 0 and max(nu, nl, nd, nr) <= n - 2:
			print('YES')
			break
	else:
		print('NO')


tc = int(input())

def check(U, R, D, L):
	combs = [(0, 0, 0, 0), (1, 0, 0, 1), (1, 1, 0, 0), (0, 0, 1, 1), (0, 1, 1, 0), (2, 1, 0, 1), (1, 0, 1, 2), (1, 1, 1, 1), (1, 2, 1, 0), (0, 1, 2, 1), (1, 0, 1, 2), (2, 1, 1, 2), (2, 2, 1, 1), (1, 2, 2, 1), (1, 1, 2, 2), (2, 2, 2, 2)]
	for (u, r, d, l) in combs:
		if n - 2 >= U - u >= 0 and n - 2 >= R - r >= 0 and (n - 2 >= D - d >= 0) and (n - 2 >= L - l >= 0):
			print('YES')
			return
	print('NO')
	return
for _ in range(tc):
	(n, U, R, D, L) = list(map(int, input().split()))
	check(U, R, D, L)


for _ in range(int(input())):
	(n, up, rt, do, le) = map(int, input().split())
	boo1 = False
	for i in range(2):
		if boo1:
			break
		for j in range(2):
			if boo1:
				break
			for k in range(2):
				if boo1:
					break
				for l in range(2):
					(a, b, c, d) = (up - i - j, rt - j - k, do - k - l, le - l - i)
					if 0 <= a <= n - 2 and 0 <= b <= n - 2 and (0 <= c <= n - 2) and (0 <= d <= n - 2):
						boo1 = True
						break
	print('YES') if boo1 else print('NO')


t = int(input())
while t > 0:
	flag = 0
	(n, u, r, d, l) = map(int, input().split())
	for i in range(0, 2):
		for j in range(0, 2):
			for k in range(0, 2):
				for m in range(0, 2):
					if 0 <= u - i - j <= n - 2 and 0 <= r - j - k <= n - 2 and (0 <= d - k - m <= n - 2) and (0 <= l - i - m <= n - 2):
						flag = 1
	if flag == 0:
		print('NO')
	else:
		print('YES')
	t = t - 1


t = int(input())
for _ in range(t):
	(n, u, r, do, l) = map(int, input().split())
	d = {}
	d['U'] = u
	d['L'] = l
	d['R'] = r
	d['D'] = do
	l = [[u, 'U'], [r, 'R'], [l, 'L'], [do, 'D']]
	l.sort()
	l = l[::-1]
	if l[0][0] > n:
		print('No')
	else:
		for i in range(4):
			if l[i][0] == n:
				if l[i][1] == 'U' or l[i][1] == 'D':
					d['L'] -= 1
					d['R'] -= 1
				elif l[i][1] == 'R' or l[i][1] == 'L':
					d['U'] -= 1
					d['D'] -= 1
			elif l[i][0] == n - 1:
				if l[i][1] == 'U' or l[i][1] == 'D':
					if d['L'] > 0:
						d['L'] -= 1
					else:
						d['R'] -= 1
				elif l[i][1] == 'R' or l[i][1] == 'L':
					if d['U'] > 0:
						d['U'] -= 1
					else:
						d['D'] -= 1
		f = 0
		for i in d:
			if d[i] < 0:
				f = 1
				break
		if f:
			print('No')
		else:
			print('Yes')


import sys
from math import ceil
from _collections import deque
from _collections import OrderedDict
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	ans = 1
	if n >= 3:
		if u == n and d == n:
			if r < 2 or l < 2:
				ans = 0
		elif u == n - 1 and d == n - 1:
			if l + r < 2:
				ans = 0
		elif (u == n or d == n) and (u == n - 1 or d == n - 1):
			if r <= 1 and l <= 1 or (r == 0 or l == 0):
				ans = 0
		elif u == n - 1 or d == n - 1:
			if l == 0 and r == 0:
				ans = 0
		elif u == n or d == n:
			if r == 0 or l == 0:
				ans = 0
		if r == n and l == n:
			if u < 2 or d < 2:
				ans = 0
		elif l == n - 1 and r == n - 1:
			if d + u < 2:
				ans = 0
		elif (l == n or r == n) and (r == n - 1 or l == n - 1):
			if u <= 1 and d <= 1 or (u == 0 or d == 0):
				ans = 0
		elif r == n - 1 or l == n - 1:
			if u == 0 and d == 0:
				ans = 0
		elif l == n or r == n:
			if u == 0 or d == 0:
				ans = 0
	elif u == n and d == n:
		if r + l != 4:
			ans = 0
	elif u == n - 1 and d == n - 1:
		if l + r != 2:
			ans = 0
	elif (u == n or d == n) and (u == n - 1 or d == n - 1):
		if r + l != 3:
			ans = 0
	elif u == n or d == n:
		if l != 1 or r != 1:
			ans = 0
	elif u == n - 1 or d == n - 1:
		if l + r != 1:
			ans = 0
	elif l + r != 0:
		ans = 0
	if ans:
		print('YES')
	else:
		print('NO')


for _ in range(eval(input())):
	(n, a, b, c, d) = [int(i) for i in input().split()]
	ans = False
	ans = [True for i in range(2) for j in range(2) for k in range(2) for l in range(2) if i + j <= a and a <= n - 2 + i + j and (j + k <= b) and (b <= n - 2 + j + k) and (k + l <= c) and (c <= n - 2 + k + l) and (l + i <= d) and (d <= n - 2 + l + i)]
	print('YES' if ans else 'NO')


import math
from collections import defaultdict
from sys import stdin
input = stdin.readline
T = int(input())
for _ in range(T):
	(n, u, r, d, l) = map(int, input().split())
	mx = max(u, r, d, l)
	(u1, r1, d1, l1) = (u, r, d, l)
	if mx <= n - 2:
		print('YES')
	else:
		if u == n:
			r1 -= 1
			l1 -= 1
		if d == n:
			r1 -= 1
			l1 -= 1
		if l == n:
			u1 -= 1
			d1 -= 1
		if r == n:
			u1 -= 1
			d1 -= 1
		if u == n - 1:
			if l1 > r1:
				l1 -= 1
			else:
				r1 -= 1
		if d == n - 1:
			if l1 > r1:
				l1 -= 1
			else:
				r1 -= 1
		if l == n - 1:
			if u1 > d1:
				u1 -= 1
			else:
				d1 -= 1
		if r == n - 1:
			if u1 > d1:
				u1 -= 1
			else:
				d1 -= 1
		if u1 >= 0 and r1 >= 0 and (d1 >= 0) and (l1 >= 0):
			print('YES')
		else:
			print('NO')


t = int(input())
for _ in range(t):
	(n, u, r, d, l) = list(map(int, input().split()))
	if u < n - 1 and r < n - 1 and (l < n - 1) and (d < n - 1):
		print('YES')
		continue
	if u > n or r > n or l > n or (d > n):
		print('NO')
		continue
	adj = [[u, l, r, d], [d, l, r, u], [r, u, d, l], [l, u, d, r]]
	valid = True
	for ad in adj:
		(x, o1, o2, y) = ad
		if x == n:
			if o1 == 0 or o2 == 0:
				valid = False
				break
			if o1 == n or o2 == n:
				if y == 0:
					valid = False
					break
			if o1 == n and o2 == n:
				if y < 2:
					valid = False
					break
			if y == n:
				if o1 < 2 or o2 < 2:
					valid = False
					break
			if y == n - 1:
				if o1 < 2 and o2 < 2:
					valid = False
					break
		elif x == n - 1:
			if o1 == 0 and o2 == 0:
				valid = False
				break
			if y == n - 1:
				if o1 + o2 < 2:
					valid = False
					break
	if valid:
		print('YES')
		continue
	print('NO')


import sys
read = sys.stdin.read
from itertools import product

def main():
	t = int(input())
	pros = tuple(product((1, 0), repeat=4))
	cases = tuple(map(int, read().split()))
	for i1 in range(t):
		(n, u, r, d, l) = cases[i1 * 5:i1 * 5 + 5]
		for pro in pros:
			j = [False] * 4
			j[0] = 0 <= u - pro[0] - pro[1] <= n - 2
			j[1] = 0 <= r - pro[1] - pro[2] <= n - 2
			j[2] = 0 <= d - pro[2] - pro[3] <= n - 2
			j[3] = 0 <= l - pro[3] - pro[0] <= n - 2
			if all(j):
				print('YES')
				break
		else:
			print('NO')
main()


def set_val(tot, val):
	if val == 0:
		return [0, tot, 0]
	elif val == 1:
		return [1, tot - 1, 0]
	elif val == 2:
		return [0, tot - 1, 1]
	elif val == 3:
		return [1, tot - 2, 1]

def is_valid(n, uu, rr, dd, ll):
	if uu[1] < 0 or rr[1] < 0 or dd[1] < 0 or (ll[1] < 0):
		return False
	if uu[1] > n - 2 or rr[1] > n - 2 or dd[1] > n - 2 or (ll[1] > n - 2):
		return False
	if uu[2] != rr[0]:
		return False
	if rr[2] != dd[0]:
		return False
	if dd[2] != ll[0]:
		return False
	if ll[2] != uu[0]:
		return False
	return True
T = int(input())
for t in range(T):
	(n, U, R, D, L) = tuple([int(x) for x in input().split()])
	nums = [U, R, D, L]
	(uu, rr, dd, ll) = ([0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0])
	got_solution = False
	for u in range(4):
		if got_solution:
			break
		uu = set_val(U, u)
		for r in range(4):
			if got_solution:
				break
			rr = set_val(R, r)
			for d in range(4):
				if got_solution:
					break
				dd = set_val(D, d)
				for l in range(4):
					ll = set_val(L, l)
					got_solution = is_valid(n, uu, rr, dd, ll)
					if got_solution:
						break
	if got_solution:
		print('YES')
	else:
		print('NO')


import math
import heapq

def S():
	return input()

def M():
	return map(int, input().split())

def I():
	return int(S())

def L():
	return list(M())
for _ in range(I()):
	(n, u, r, d, l) = M()
	(u1, r1, d1, l1) = (u, r, d, l)
	if u > n - 2:
		if u == n - 1:
			if r < l:
				l -= 1
			else:
				r -= 1
		else:
			r -= 1
			l -= 1
	if r < 0 or l < 0:
		print('NO')
	else:
		if d > n - 2:
			if d == n - 1:
				if r < l:
					l -= 1
				else:
					r -= 1
			else:
				l -= 1
				r -= 1
		if r < 0 or l < 0:
			print('NO')
		else:
			u = r1
			d = l1
			l = u1
			r = d1
			if u > n - 2:
				if u == n - 1:
					if r < l:
						l -= 1
					else:
						r -= 1
				else:
					r -= 1
					l -= 1
			if r < 0 or l < 0:
				print('NO')
			else:
				if d > n - 2:
					if d == n - 1:
						if r < l:
							l -= 1
						else:
							r -= 1
					else:
						l -= 1
						r -= 1
				if r < 0 or l < 0:
					print('NO')
				else:
					print('YES')


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
from collections import OrderedDict
from collections import defaultdict
import bisect
import math
from sys import setrecursionlimit

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def fre_count(mylist):
	return Counter(mylist)

def lcm(a, b):
	return a / gcd(a, b) * b

def main():
	t = int(input())
	for _ in range(t):
		(n, U, R, D, L) = map(int, input().split())
		if max(U, R, D, L) > n:
			print('NO')
			continue
		if U == n and (R == 0 or L == 0):
			print('NO')
			continue
		if D == n and (R == 0 or L == 0):
			print('NO')
			continue
		if R == n and (U == 0 or D == 0):
			print('NO')
			continue
		if L == n and (U == 0 or D == 0):
			print('NO')
			continue
		if U == n and D == n and (L <= 1 or R <= 1):
			print('NO')
			continue
		if L == n and R == n and (U <= 1 or D <= 1):
			print('NO')
			continue
		if U <= 1 and D <= 1 and (R == n - 1 and L == n or (L == n - 1 and R == n)):
			print('NO')
			continue
		if R <= 1 and L <= 1 and (U == n - 1 and D == n or (D == n - 1 and U == n)):
			print('NO')
			continue
		if L == 0 and R == 0 and (U == n - 1 or D == n - 1):
			print('NO')
			continue
		if (L == 1 and R == 0 or (L == 0 and R == 1)) and (U == n - 1 and D == n - 1):
			print('NO')
			continue
		if U == 0 and D == 0 and (L == n - 1 or R == n - 1):
			print('NO')
			continue
		if (U == 1 and D == 0 or (U == 0 and D == 1)) and (L == n - 1 and R == n - 1):
			print('NO')
			continue
		print('YES')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	(n, U, R, D, L) = map(int, input().split(' '))
	ans = 'NO'
	for a in range(2):
		for b in range(2):
			for c in range(2):
				for d in range(2):
					if 0 <= U - a - b <= n - 2 and 0 <= R - a - c <= n - 2 and (0 <= D - c - d <= n - 2) and (0 <= L - b - d <= n - 2):
						ans = 'YES'
	print(ans)


t = int(input())
for _ in range(t):
	(n, u, r, d, l) = map(int, input().split())
	hcarry = 0
	vcarry = 0
	flag = 0
	useless = 0
	l1 = [0 for j in range(4)]
	inp = [0 for j in range(4)]
	inp[0] = u
	inp[1] = d
	inp[2] = l
	inp[3] = r
	for i in range(2):
		a = inp[i]
		if a == n:
			l1[2] += 1
			l1[3] += 1
		elif a == n - 1:
			hcarry += 1
	for i in range(2, 4):
		a = inp[i]
		if a == n:
			l1[0] += 1
			l1[1] += 1
		elif a == n - 1:
			vcarry += 1
	if l1[0] <= u and l1[1] <= d:
		if l1[0] + l1[1] + vcarry <= u + d:
			useless = 0
		else:
			flag = 1
	else:
		flag = 1
	if l1[2] <= l and l1[3] <= r:
		if l1[2] + l1[3] + hcarry <= l + r:
			useless = 0
		else:
			flag = 1
	else:
		flag = 1
	if flag == 0:
		print('YES')
	else:
		print('NO')


T = int(input())
BinaryToMat = {0: [[0, 0], [0, 0]], 1: [[1, 0], [0, 0]], 2: [[0, 1], [0, 0]], 3: [[1, 1], [0, 0]], 4: [[0, 0], [0, 1]], 5: [[1, 0], [0, 1]], 6: [[0, 1], [0, 1]], 7: [[1, 1], [0, 1]], 8: [[0, 0], [1, 0]], 9: [[1, 0], [1, 0]], 10: [[0, 1], [1, 0]], 11: [[1, 1], [1, 0]], 12: [[0, 0], [1, 1]], 13: [[1, 0], [1, 1]], 14: [[0, 1], [1, 1]], 15: [[1, 1], [1, 1]]}

def CheckFit(mat, n, U, R, D, L):
	result = True
	if U - (mat[0][0] + mat[0][1]) >= 0:
		if n - 2 >= U - (mat[0][0] + mat[0][1]):
			result = True
		else:
			return False
	else:
		return False
	if R - (mat[1][1] + mat[0][1]) >= 0:
		if n - 2 >= R - (mat[1][1] + mat[0][1]):
			result = True
		else:
			return False
	else:
		return False
	if D - (mat[1][0] + mat[1][1]) >= 0:
		if n - 2 >= D - (mat[1][0] + mat[1][1]):
			result = True
		else:
			return False
	else:
		return False
	if L - (mat[1][0] + mat[0][0]) >= 0:
		if n - 2 >= L - (mat[1][0] + mat[0][0]):
			result = True
		else:
			return False
	else:
		return False
	return result

def Solve(n, U, R, D, L):
	for i in range(16):
		mat = BinaryToMat[i]
		flag2 = True
		if CheckFit(mat, n, U, R, D, L):
			return 'YES'
	return 'NO'
for i in range(T):
	(n, U, R, D, L) = list(map(int, input().split()))
	print(Solve(n, U, R, D, L))


t = int(input())
for tc in range(t):
	(n, u, r, d, l) = map(int, input().split())
	result = True
	D = [u, r, d, l]
	for i in range(4):
		if D[i] == 0:
			maxSideBlockCount = n - 1
			if D[(i + 2) % 4] == 0:
				maxSideBlockCount = n - 2
			if D[(i + 1) % 4] > maxSideBlockCount or D[(i + 3) % 4] > maxSideBlockCount:
				result = False
				break
			if D[(i + 1) % 4] == n - 1 and D[(i + 3) % 4] == n - 1 and (D[(i + 2) % 4] < 2):
				result = False
				break
		elif D[i] == n:
			minSideBlockCount = 1
			if D[(i + 2) % 4] == n:
				minSideBlockCount = 2
			if D[(i + 1) % 4] < minSideBlockCount or D[(i + 3) % 4] < minSideBlockCount:
				result = False
				break
			if D[(i + 1) % 4] == 1 and D[(i + 3) % 4] == 1 and (D[(i + 2) % 4] > n - 2):
				result = False
				break
	print('YES' if result else 'NO')


import sys
input = sys.stdin.readline

def solution(n, a, b, c, d):
	xab = xbc = xcd = xda = 0
	rest_a = rest_b = rest_c = rest_d = 0
	for xab in [0, 1]:
		for xbc in [0, 1]:
			for xcd in [0, 1]:
				for xda in [0, 1]:
					rest_a = a - xab - xda
					rest_b = b - xab - xbc
					rest_c = c - xbc - xcd
					rest_d = d - xcd - xda
					if min([rest_a, rest_b, rest_c, rest_d]) >= 0 and max([rest_a, rest_b, rest_c, rest_d]) <= n - 2:
						print('YES')
						return
	print('NO')
T = int(input())
for t in range(T):
	[n, a, b, c, d] = list(map(int, input().split()))
	solution(n, a, b, c, d)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def intArr():
	return map(int, input().split())

def In():
	return int(input())

def check(l1: list, l2: list):
	(u, l, d, r) = l2
	if u[0] == 1 or l[0] == 1:
		u[0] = l[0] = 1
	if u[2] == 1 or r[0] == 1:
		u[2] = r[0] = 1
	if d[0] == 1 or l[2] == 1:
		d[0] = l[2] = 1
	if d[2] == 1 or r[2] == 1:
		d[2] = r[2] = 1
	l2 = [u, l, d, r]
	for i in range(4):
		if l1[i] != sum(l2[i]):
			return 0
	return 1

def func(n, u, r, d, l0):
	l1 = [u, l0, d, r]
	temp = [[] for _ in range(4)]
	for i in range(4):
		temp[i] = [[0, min(n - 2, l1[i]), 0], [1, max(0, min(n - 2, l1[i] - 1)), 0], [0, max(0, min(n - 2, l1[i] - 1)), 1], [1, max(0, min(n - 2, l1[i] - 2)), 1]]
	for a in temp[0]:
		for b in temp[1]:
			for c in temp[2]:
				for p in temp[3]:
					tempo = [a.copy(), b.copy(), c.copy(), p.copy()]
					if check(l1, tempo):
						return 'YES'
	return 'NO'

def main():
	for _ in range(In()):
		(n, u, r, d, l0) = intArr()
		print(func(n, u, r, d, l0))
	return
main()


import sys, io, os
input = lambda : sys.stdin.readline().encode()
read = lambda : map(int, input().split())
import itertools
out = []
for _ in range(int(input())):
	(n, u, r, d, l) = read()
	res = False
	for (v1, v2, v3, v4) in itertools.product((0, 1), repeat=4):
		b = 0 <= u - v1 - v2 <= n - 2 and 0 <= r - v2 - v3 <= n - 2 and (0 <= d - v3 - v4 <= n - 2) and (0 <= l - v4 - v1 <= n - 2)
		res = res or b
	out.append(['NO', 'YES'][res])
print('\n'.join(out))


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.buffer.readline())

def MI():
	return map(int, sys.stdin.buffer.readline().split())

def LI():
	return list(map(int, sys.stdin.buffer.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def BI():
	return sys.stdin.buffer.readline().rstrip()

def SI():
	return sys.stdin.buffer.readline().rstrip().decode()
inf = 10 ** 16
md = 10 ** 9 + 7

def ok():
	for i in range(4):
		if aa[i - 1] == n and (aa[i] == 0 or aa[i - 2] == 0):
			return False
		if aa[i - 1] == n - 1 and aa[i] == 0 and (aa[i - 2] == 0):
			return False
		if aa[i] == n and aa[i - 2] == n and (aa[i - 1] < 2 or aa[i - 3] < 2):
			return False
		if aa[i] == n and aa[i - 2] == n - 1 and (aa[i - 1] + aa[i - 3] < 3):
			return False
		if aa[i] == n - 1 and aa[i - 2] == n - 1 and (aa[i - 1] + aa[i - 3] < 2):
			return False
	return True
for _ in range(II()):
	(n, *aa) = MI()
	print('YES' if ok() else 'NO')


def main():
	t = int(input())
	allans = []
	for _ in range(t):
		(n, U, R, D, L) = readIntArr()
		ok = False
		for cornerBin in range(2 ** 4):
			b = cornerBin
			minU = minR = minD = minL = 0
			if b & 1 << 0 > 0:
				minU += 1
				minL += 1
			if b & 1 << 1 > 0:
				minU += 1
				minR += 1
			if b & 1 << 2 > 0:
				minD += 1
				minR += 1
			if b & 1 << 3 > 0:
				minD += 1
				minL += 1
			maxU = maxR = maxD = maxL = n
			if b & 1 << 0 == 0:
				maxU -= 1
				maxL -= 1
			if b & 1 << 1 == 0:
				maxU -= 1
				maxR -= 1
			if b & 1 << 2 == 0:
				maxD -= 1
				maxR -= 1
			if b & 1 << 3 == 0:
				maxD -= 1
				maxL -= 1
			if minU <= U <= maxU and minR <= R <= maxR and (minD <= D <= maxD) and (minL <= L <= maxL):
				ok = True
		if ok:
			allans.append('YES')
		else:
			allans.append('NO')
	multiLineArrayPrint(allans)
	return
import sys
input = sys.stdin.buffer.readline

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]
inf = float('inf')
MOD = 10 ** 9 + 7
main()


def check(n, l, r, u, b):
	if min(l, r) == n:
		if u >= 2 and b >= 2:
			return 1
		else:
			return 0
	elif min(l, r) == n - 1 and max(l, r) == n:
		if u >= 1 and b >= 1 and (u + b >= 3):
			return 1
		else:
			return 0
	elif max(l, r) == n and min(l, r) < n - 1:
		if u >= 1 and b >= 1:
			return 1
		else:
			return 0
	elif min(l, r) == max(l, r) == n - 1:
		if u + b >= 2:
			return 1
		else:
			return 0
	elif max(l, r) == n - 1:
		if u + b >= 1:
			return 1
		else:
			return 0
	else:
		return 1
for _ in range(int(input())):
	(n, u, r, b, l) = map(int, input().split())
	if check(n, l, r, u, b) + check(n, u, b, l, r) == 2:
		print('YES')
	else:
		print('NO')


import sys, io, os, time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'

def ceil(num, denom):
	return (num + denom - 1) // denom
input = sys.stdin.readline
for _ in range(int(input())):
	(n, U, R, D, L) = map(int, input().split())
	for mask in range(16):
		(rU, rR, rD, rL) = (U, R, D, L)
		if mask & 1:
			rU -= 1
			rL -= 1
		if mask & 2:
			rL -= 1
			rD -= 1
		if mask & 4:
			rD -= 1
			rR -= 1
		if mask & 8:
			rR -= 1
			rU -= 1
		if min(rU, rR, rD, rL) >= 0 and max(rU, rR, rD, rL) <= n - 2:
			print('YES')
			break
	else:
		print('NO')


def solve():
	m = list(map(int, input().split()))
	(n, a) = (m[0], m[1:])
	for i in range(2):
		s1 = max(0, a[i] - (n - 1)) + max(0, a[i + 2] - (n - 1))
		if s1 > a[i + 1] or s1 > a[(i + 3) % 4]:
			return 'NO'
		s2 = max(0, a[i] - (n - 2)) + max(0, a[i + 2] - (n - 2))
		if s2 > a[i + 1] + a[(i + 3) % 4]:
			return 'NO'
	return 'YES'
t = int(input())
for _ in range(t):
	print(solve())


import sys

def readInts():
	return [int(x) for x in sys.stdin.readline().split()]

def readInt():
	return int(sys.stdin.readline())
corners = [(0, 0, 0, 0), (0, 0, 0, 1), (0, 0, 1, 0), (0, 0, 1, 1), (0, 1, 0, 0), (0, 1, 0, 1), (0, 1, 1, 0), (0, 1, 1, 1), (1, 0, 0, 0), (1, 0, 0, 1), (1, 0, 1, 0), (1, 0, 1, 1), (1, 1, 0, 0), (1, 1, 0, 1), (1, 1, 1, 0), (1, 1, 1, 1)]

def solve():
	[n, u, r, d, l] = readInts()
	for corner in corners:
		u1 = u - corner[0] - corner[1]
		r1 = r - corner[1] - corner[2]
		d1 = d - corner[2] - corner[3]
		l1 = l - corner[0] - corner[3]
		check = u1 >= 0 and u1 < n - 1 and (r1 >= 0) and (r1 < n - 1) and (d1 >= 0) and (d1 < n - 1) and (l1 >= 0) and (l1 < n - 1)
		if check:
			print('YES')
			return
	print('NO')

def main():
	t = readInt()
	for _ in range(t):
		solve()
main()


def solve():
	(n, u, r, d, l) = map(int, input().split())
	(n1, u1, r1, d1, l1) = (n, u, r, d, l)
	if u == n:
		(l1, r1) = (l1 - 1, r1 - 1)
	if r == n:
		(u1, d1) = (u1 - 1, d1 - 1)
	if d == n:
		(l1, r1) = (l1 - 1, r1 - 1)
	if l == n:
		(u1, d1) = (u1 - 1, d1 - 1)
	if u == n - 1:
		if l1 > r1:
			l1 -= 1
		else:
			r1 -= 1
	if r == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	if d == n - 1:
		if l1 > r1:
			l1 -= 1
		else:
			r1 -= 1
	if l == n - 1:
		if u1 > d1:
			u1 -= 1
		else:
			d1 -= 1
	if u1 < 0 or d1 < 0 or l1 < 0 or (r1 < 0):
		return 'NO'
	else:
		return 'YES'
res = ''
for _ in range(int(input())):
	res += solve() + '\n'
print(res)


from bisect import *
from collections import *
from math import gcd, ceil, sqrt, floor, inf
from heapq import *
from itertools import *
from operator import add, mul, sub, xor, truediv, floordiv
from functools import *
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def A(n):
	return [0] * n

def AI(n, x):
	return [x] * n

def G(n):
	return [[] for i in range(n)]

def GP(it):
	return [[ch, len(list(g))] for (ch, g) in groupby(it)]
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc
mod = 10 ** 9 + 7
farr = [1]
ifa = []

def fact(x, mod=0):
	if mod:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr) % mod)
	else:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr))
	return farr[x]

def ifact(x, mod):
	global ifa
	fact(x, mod)
	ifa.append(pow(farr[-1], mod - 2, mod))
	for i in range(x, 0, -1):
		ifa.append(ifa[-1] * i % mod)
	ifa.reverse()

def per(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return fact(i) // fact(i - j)
	return farr[i] * ifa[i - j] % mod

def com(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return per(i, j) // fact(j)
	return per(i, j, mod) * ifa[j] % mod

def catalan(n):
	return com(2 * n, n) // (n + 1)

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def floorsum(a, b, c, n):
	if a == 0:
		return b // c * (n + 1)
	if a >= c or b >= c:
		return floorsum(a % c, b % c, c, n) + b // c * (n + 1) + a // c * n * (n + 1) // 2
	m = (a * n + b) // c
	return n * m - floorsum(c, c - b - 1, a, m - 1)

def inverse(a, m):
	a %= m
	if a <= 1:
		return a
	return (1 - inverse(m, a) * m) // a % m

def lowbit(n):
	return n & -n

class BIT:

	def __init__(self, arr):
		self.arr = arr
		self.n = len(arr) - 1

	def update(self, x, v):
		while x <= self.n:
			self.arr[x] += v
			x += x & -x

	def query(self, x):
		ans = 0
		while x:
			ans += self.arr[x]
			x &= x - 1
		return ans

class ST:

	def __init__(self, arr):
		n = len(arr)
		mx = n.bit_length()
		self.st = [[0] * mx for i in range(n)]
		for i in range(n):
			self.st[i][0] = arr[i]
		for j in range(1, mx):
			for i in range(n - (1 << j) + 1):
				self.st[i][j] = max(self.st[i][j - 1], self.st[i + (1 << j - 1)][j - 1])

	def query(self, l, r):
		if l > r:
			return -inf
		s = (r + 1 - l).bit_length() - 1
		return max(self.st[l][s], self.st[r - (1 << s) + 1][s])

class UFS:

	def __init__(self, n):
		self.parent = [i for i in range(n)]
		self.ranks = [0] * n

	def find(self, x):
		if x != self.parent[x]:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, u, v):
		(pu, pv) = (self.find(u), self.find(v))
		if pu == pv:
			return False
		if self.ranks[pu] >= self.ranks[pv]:
			self.parent[pv] = pu
			if self.ranks[pv] == self.ranks[pu]:
				self.ranks[pu] += 1
		else:
			self.parent[pu] = pv

def Prime(n):
	c = 0
	prime = []
	flag = [0] * (n + 1)
	for i in range(2, n + 1):
		if not flag[i]:
			prime.append(i)
			c += 1
		for j in range(c):
			if i * prime[j] > n:
				break
			flag[i * prime[j]] = prime[j]
			if i % prime[j] == 0:
				break
	return flag

def dij(s, graph):
	d = {}
	d[s] = 0
	heap = [(0, s)]
	seen = set()
	while heap:
		(dis, u) = heappop(heap)
		if u in seen:
			continue
		seen.add(u)
		for (v, w) in graph[u]:
			if v not in d or d[v] > d[u] + w:
				d[v] = d[u] + w
				heappush(heap, (d[v], v))
	return d

def bell(s, g):
	dis = AI(n, inf)
	dis[s] = 0
	for i in range(n - 1):
		for (u, v, w) in edge:
			if dis[v] > dis[u] + w:
				dis[v] = dis[u] + w
	change = A(n)
	for i in range(n):
		for (u, v, w) in edge:
			if dis[v] > dis[u] + w:
				dis[v] = dis[u] + w
				change[v] = 1
	return dis

def lcm(a, b):
	return a * b // gcd(a, b)

def lis(nums):
	res = []
	for k in nums:
		i = bisect.bisect_left(res, k)
		if i == len(res):
			res.append(k)
		else:
			res[i] = k
	return len(res)

def RP(nums):
	n = len(nums)
	s = set(nums)
	d = {}
	for (i, k) in enumerate(sorted(s), 1):
		d[k] = i
	bi = BIT([0] * (len(s) + 1))
	ans = 0
	for i in range(n - 1, -1, -1):
		ans += bi.query(d[nums[i]] - 1)
		bi.update(d[nums[i]], 1)
	return ans

class DLN:

	def __init__(self, val):
		self.val = val
		self.pre = None
		self.next = None

def nb(i, j, n, m):
	for (ni, nj) in [[i + 1, j], [i - 1, j], [i, j - 1], [i, j + 1]]:
		if 0 <= ni < n and 0 <= nj < m:
			yield (ni, nj)

def topo(n):
	q = deque()
	res = []
	for i in range(1, n + 1):
		if ind[i] == 0:
			q.append(i)
			res.append(i)
	while q:
		u = q.popleft()
		for v in g[u]:
			ind[v] -= 1
			if ind[v] == 0:
				q.append(v)
				res.append(v)
	return res

@bootstrap
def gdfs(r, p):
	if len(g[r]) == 1 and p != -1:
		yield None
	for ch in g[r]:
		if ch != p:
			yield gdfs(ch, r)
	yield None
t = N()
for i in range(t):
	(n, u, r, x, l) = RL()
	ans = False
	for i in range(16):
		(U, R, X, L) = (u, r, x, l)
		(a, b, c, d) = (i >> 3 & 1, i >> 2 & 1, i >> 1 & 1, i & 1)
		u -= a + b
		r -= b + c
		x -= c + d
		l -= a + d
		if n - 2 >= u >= 0 and n - 2 >= r >= 0 and (n - 2 >= x >= 0) and (n - 2 >= l >= 0):
			ans = True
			break
		(u, r, x, l) = (U, R, X, L)
	if ans:
		print('YES')
	else:
		print('NO')


import math

def solve(n, U, R, D, L):
	for i in range(16):
		(u, r, d, l) = (0, 0, 0, 0)
		if i % 2 == 0:
			u += 1
			r += 1
		if i // 2 % 2 == 0:
			u += 1
			l += 1
		if i // 4 % 2 == 0:
			d += 1
			r += 1
		if i // 8 % 2 == 0:
			d += 1
			l += 1
		if l <= L and L <= l + n - 2 and (u <= U) and (U <= u + n - 2) and (d <= D) and (D <= d + n - 2) and (r <= R) and (R <= r + n - 2):
			return 'YES'
	return 'NO'

def main():
	ans = []
	t = int(input())
	for _ in range(t):
		(n, U, R, D, L) = map(int, input().split(' '))
		ans.append(solve(n, U, R, D, L))
	for a in ans:
		print(a)
main()


from sys import stdin, stdout

def gmi():
	return map(int, stdin.readline().strip().split())

def gms():
	return map(str, stdin.readline().strip().split())

def gari():
	return list(map(int, stdin.readline().strip().split()))

def gars():
	return list(map(str, stdin.readline().strip().split()))

def gs():
	return stdin.readline().strip()

def gls():
	return list(stdin.readline().strip())

def gi():
	return int(stdin.readline())
T = gi()
while T:
	T -= 1
	ans = 'YES'
	(n, u, r, d, l) = gmi()
	ar = [u, r, d, l]
	br = ar[:]
	for i in range(4):
		if ar[i] == n:
			br[i - 1] -= 1
			br[(i + 1) % 4] -= 1
	for i in range(4):
		if ar[i] == n - 1:
			if br[i - 1] >= br[(i + 1) % 4]:
				br[i - 1] -= 1
			else:
				br[(i + 1) % 4] -= 1
	for i in br:
		if i < 0:
			ans = 'NO'
			break
	print(ans)


for _ in range(int(input())):
	(n, U, R, D, L) = map(int, input().split())
	if U < n - 2 and R < n - 2 and (D < n - 2) and (L < n - 2):
		print('YES')
	else:
		edges = [U, R, D, L]
		for mask in range(15, -1, -1):
			corners = [0] * 4
			for i in range(4):
				if mask & 1:
					corners[i] = 1
				mask >>= 1
			corners.append(corners[0])
			for i in range(4):
				left = edges[i] - corners[i] - corners[i + 1]
				if left < 0 or left > n - 2:
					break
			else:
				print('YES')
				break
		else:
			print('NO')


import sys
from collections import *
import math
import bisect

def input():
	return sys.stdin.readline()
for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	div = n - 2
	ans = False
	ll = [0, 1]
	for x in ll:
		for y in ll:
			for z in ll:
				for k in ll:
					c1 = u - x - y
					c2 = r - y - k
					c3 = d - z - k
					c4 = l - z - x
					if c1 >= 0 and c1 <= div and (c2 >= 0) and (c2 <= div) and (c3 >= 0) and (c3 <= div) and (c4 >= 0) and (c4 <= div):
						ans = True
						break
				if ans:
					break
			if ans:
				break
		if ans:
			break
	if ans:
		print('YES')
	else:
		print('NO')


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
sys.setrecursionlimit(1000000)
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(n, U, R, D, L) = map(int, input().split())
	check = True
	for i in range(16):
		(rU, rR, rD, rL) = (U, R, D, L)
		if i & 1:
			rU -= 1
			rL -= 1
		if i & 2:
			rU -= 1
			rR -= 1
		if i & 4:
			rR -= 1
			rD -= 1
		if i & 8:
			rL -= 1
			rD -= 1
		if min(rU, rR, rD, rL) >= 0 and max(rU, rR, rD, rL) <= n - 2:
			print('YES')
			check = False
			break
	if check:
		print('NO')


from itertools import product
from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	for p in product([0, 1], repeat=4):
		if u >= p[0] + p[1] >= max(u - n + 2, 0) and r >= p[1] + p[2] >= max(r - n + 2, 0) and (d >= p[2] + p[3] >= max(d - n + 2, 0)) and (l >= p[3] + p[0] >= max(l - n + 2, 0)):
			print('YES')
			break
	else:
		print('NO')


T = int(input())
while T > 0:
	T -= 1
	inp = input().split()
	n = int(inp[0])
	a = [int(x) for x in inp[1:]]
	ans = True
	check = [False, False, False, False]
	for i in range(len(a)):
		if a[i] == n:
			a[(i + 1) % len(a)] -= 1
			a[i - 1] -= 1
			a[i] -= 2
			check[i] = True
	for i in range(len(a)):
		if a[i] == n - 1:
			a[i] = a[i] - 1
			if a[(i + 1) % len(a)] >= 1 and (not check[(i + 1) % len(a)]):
				a[(i + 1) % len(a)] = a[(i + 1) % len(a)] - 1
			elif a[i - 1] >= 1 and (not check[i - 1]):
				a[i - 1] = a[i - 1] - 1
			else:
				ans = False
	for i in range(len(a)):
		if a[i] < 0 or a[i] > n - 2:
			ans = False
	if ans:
		print('YES')
	else:
		print('NO')


def fa(n, U, R, D, L):
	rcnt = n
	ccnt = n
	if U == 0:
		rcnt = rcnt - 1
	if D == 0:
		rcnt = rcnt - 1
	if R == 0:
		ccnt = ccnt - 1
	if L == 0:
		ccnt = ccnt - 1
	if U > ccnt or D > ccnt or L > rcnt or (R > rcnt):
		return 0
	if (U == 1 or D == 1) and R == rcnt and (L == rcnt):
		return 0
	if (R == 1 or L == 1) and U == ccnt and (D == ccnt):
		return 0
	if U == 1 and D == 1 and (R == rcnt and L > rcnt - 2 or (L == rcnt and R > rcnt - 2)):
		return 0
	if L == 1 and R == 1 and (U == ccnt and D > ccnt - 2 or (D == ccnt and U > ccnt - 2)):
		return 0
	return 1
T = int(input())
for _ in range(T):
	(n, U, R, D, L) = map(int, input().split())
	ans = fa(n, U, R, D, L)
	if ans == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, U, R, D, L) = map(int, input().split())
	cnt = 0
	for mask in range(16):
		(U1, R1, D1, L1) = (U, R, D, L)
		if 1 & mask:
			U1 -= 1
			L1 -= 1
		if 2 & mask:
			U1 -= 1
			R1 -= 1
		if 4 & mask:
			D1 -= 1
			R1 -= 1
		if 8 & mask:
			D1 -= 1
			L1 -= 1
		if min(U1, R1, D1, L1) >= 0 and max(U1, R1, D1, L1) <= n - 2:
			cnt = 1
			break
	if cnt:
		print('YES')
	else:
		print('NO')


t = int(input())

def check(com, seq, n):
	ft = 0
	l = []
	for i in range(4):
		app = seq[i] - com[i]
		if app < 0:
			ft += 1
		l.append(app)
	if ft == 0 and n not in l and (n - 1 not in l):
		return 1
	return 0
for lp in range(t):
	(n, U, R, D, L) = [int(y) for y in input().split()]
	nc = (U, R, D, L)
	l = []
	for k1 in range(2):
		for k2 in range(2):
			for k3 in range(2):
				for k4 in range(2):
					l.append((k1 + k2, k2 + k4, k3 + k4, k1 + k3))
	for com in l:
		if check(com, nc, n) == 1:
			print('YES')
			break
	else:
		print('NO')


_ = int(input())
for _ai in range(_):
	li = [int(i) for i in input().split()]
	ali = [0, 0, 0, 0]
	n = li[0]
	li = li[1:]
	flag = 1
	if n == 1:
		for i in range(4):
			if li[i] != 1:
				flag = 0
	else:
		for i in range(4):
			l = i - 1
			if l < 0:
				l = 3
			r = i + 1
			if r > 3:
				r = 0
			if li[i] == n:
				ali[l] += 1
				ali[r] += 1
			elif li[i] == n - 1:
				if li[r] > li[l]:
					ali[r] += 1
				else:
					ali[l] += 1
		for i in range(4):
			if li[i] < ali[i]:
				flag = 0
	print('YES') if flag else print('NO')


def solve(n, U, R, D, L):
	if n == 1:
		if U == 1 and L == 1 and (D == 1) and (R == 1):
			return 'YES'
		else:
			return 'NO'
	u = 0
	r = 0
	d = 0
	l = 0
	if U == n:
		l += 1
		r += 1
	if D == n:
		l += 1
		r += 1
	if L == n:
		u += 1
		d += 1
	if R == n:
		u += 1
		d += 1
	if U == n - 1:
		if L > l:
			l += 1
		else:
			r += 1
	if D == n - 1:
		if L > l:
			l += 1
		else:
			r += 1
	if L == n - 1:
		if D > d:
			d += 1
		else:
			u += 1
	if R == n - 1:
		if D > d:
			d += 1
		else:
			u += 1
	if U >= u and R >= r and (D >= d) and (L >= l):
		return 'YES'
	else:
		return 'NO'
t = int(input())
for i in range(t):
	(n, U, R, D, L) = map(int, input().split())
	print(solve(n, U, R, D, L))


for t in range(int(input())):
	(n, u, r, d, l) = [int(k) for k in input().split()]
	li = [u, r, d, l, u]
	if max(li) < n - 1:
		print('YES')
		continue
	newli = [0, 0, 0, 0, 0]
	flag = 0
	for i in range(4):
		if li[i] == n:
			newli[(i + 1) % 4] += 1
			newli[(i - 1) % 4] += 1
		elif li[i] == n - 1:
			if li[(i - 1) % 4] > li[(i + 1) % 4]:
				newli[(i - 1) % 4] += 1
			else:
				newli[(i + 1) % 4] += 1
	for i in range(4):
		if li[i] < newli[i]:
			print('NO')
			break
	else:
		print('YES')


for _ in range(int(input())):
	(n, u, r, d, l) = map(int, input().split())
	p = 'NO'
	for a in range(2):
		for b in range(2):
			for c in range(2):
				for o in range(2):
					if a + b <= u and n - 2 + a + b >= u and (b + c <= r) and (n - 2 + b + c >= r) and (c + o <= d) and (n - 2 + c + o >= d) and (o + a <= l) and (n - 2 + o + a >= l):
						p = 'YES'
	print(p)


for _ in range(int(input())):
	(n, U, R, D, L) = map(int, input().split())
	flag = 0
	for i in range(2):
		if flag:
			break
		for j in range(2):
			if flag:
				break
			for k in range(2):
				if flag:
					break
				for l in range(2):
					(a, b, c, d) = (U - i - j, R - j - k, D - k - l, L - l - i)
					if 0 <= a <= n - 2 and 0 <= b <= n - 2 and (0 <= c <= n - 2) and (0 <= d <= n - 2):
						flag = 1
						break
	print('YES' if flag else 'NO')


import os, sys, heapq as h, time
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import bisect_left, bisect_right
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def getInt():
	return int(input())

def getStrs():
	return input().split()

def getInts():
	return list(map(int, input().split()))

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]

def isInt(s):
	return '0' <= s[0] <= '9'
MOD = 10 ** 9 + 7

def solve():
	(N, U, R, D, L) = getInts()
	for i in range(2):
		for j in range(2):
			for k in range(2):
				for l in range(2):
					u = U - i - j
					r = R - i - k
					d = D - k - l
					l = L - j - l
					if min(u, r, d, l) >= 0 and max(u, r, d, l) <= N - 2:
						return 'YES'
	return 'NO'
for _ in range(getInt()):
	print(solve())


t = int(input())
answers = []
for _ in range(t):
	data = input()
	data = list(map(int, data.split(' ')))
	(n, U, R, D, L) = data
	if max(data) > n or 2 > n or n > 100:
		answers.append('NO')
	else:
		n = data[0]
		if n == data[1]:
			L -= 1
			R -= 1
		elif n == data[1] + 1:
			if L > R:
				L -= 1
			else:
				R -= 1
		if n == data[2]:
			U -= 1
			D -= 1
		elif n == data[2] + 1:
			if D > U:
				D -= 1
			else:
				U -= 1
		if n == data[3]:
			R -= 1
			L -= 1
		elif n == data[3] + 1:
			if R > L:
				R -= 1
			else:
				L -= 1
		if n == data[4]:
			U -= 1
			D -= 1
		elif n == data[4] + 1:
			if D > U:
				D -= 1
			else:
				U -= 1
		if min((U, R, D, L)) < 0:
			answers.append('NO')
		else:
			answers.append('YES')
for a in answers:
	print(a)


import math
import collections

def read_list() -> list:
	return [int(i) for i in input().strip().split()]

def read_num() -> int:
	return int(input().strip())

def solve():
	params = read_list()
	n = params[0]
	(u, r, d, l) = params[1:]
	for i in range(2 << 4):
		tmp = [u, r, d, l]
		status = i
		for j in range(4):
			color = status & 1
			status >>= 1
			tmp[j] -= color
			tmp[j - 1] -= color
		if min(tmp) >= 0 and max(tmp) <= n - 2:
			return 'YES'
	return 'NO'
t = read_num()
for _ in range(t):
	print(solve())


t = int(input())

def check(n, m, u, r, d, l):
	f = [1 if m & 1 << x else 0 for x in range(4)]
	flist = [u - f[0] - f[1], r - f[1] - f[2], d - f[2] - f[3], l - f[3] - f[0]]
	for i in flist:
		if i < 0 or i > n - 2:
			return False
	return True
for _ in range(t):
	(n, u, r, d, l) = list(map(int, input().split(' ')))
	flag = False
	for i in range(1 << 4):
		if check(n, i, u, r, d, l):
			print('YES')
			flag = True
			break
	if not flag:
		print('NO')


for _ in range(int(input())):
	(n, u, r, d, l) = [int(i) for i in input().split(' ')]
	a = [u, r, d, l]
	x = []
	f = 0
	for i in range(4):
		x.append([i, a[i]])
	x = sorted(x, key=lambda x: x[1], reverse=True)
	for i in x:
		if i[1] == n:
			a[(i[0] + 1) % 4] -= 1
			a[i[0] - 1] -= 1
			if min(a) < 0:
				f = 1
				break
		elif i[1] == n - 1:
			if a[(i[0] + 1) % 4] > a[i[0] - 1]:
				a[(i[0] + 1) % 4] -= 1
			else:
				a[i[0] - 1] -= 1
			if min(a) < 0:
				f = 1
				break
	if f == 0:
		print('YES')
	else:
		print('NO')


res = 0

def compare(a, b):
	res = 0
	res += 1
	return (a == n) + (b == n)

def half(a, b):
	res = 0
	res += 1
	suma = a == n - 1
	suma += b == n - 1
	suma += 2 * (a == n)
	suma += 2 * (b == n)
	return suma
t = int(input())
for i in range(t):
	(n, u, r, d, l) = map(int, input().split())
	res += 1
	answer = 1
	res += 1
	if u < n - 1 and r < n - 1 and (l < n - 1) and (d < n - 1):
		res += 1
		print('YES')
		res += 1
		continue
	res += 1
	if u >= 2 and r >= 2 and (l >= 2) and (d >= 2):
		res += 1
		print('YES')
		res += 1
		continue
	res += 1
	if u < compare(l, r):
		res += 1
		answer = 0
	if d < compare(l, r):
		res += 1
		answer = 0
	if l < compare(u, d):
		res += 1
		answer = 0
	if r < compare(u, d):
		res += 1
		answer = 0
	if u + d < half(l, r):
		res += 1
		answer = 0
	if l + r < half(u, d):
		res += 1
		answer = 0
	res += 1
	if answer:
		print('YES')
	else:
		print('NO')


def ans(n, U, R, D, L):
	temp = max(U, R, L, D)
	if temp <= n - 2:
		return 'YES'
	elif temp == n:
		if U == n:
			if D == n:
				if R >= 2 and L >= 2:
					pass
				else:
					return 'NO'
			elif D == n - 1:
				if R >= 2 and L >= 1 or (L >= 2 and R >= 1):
					pass
				else:
					return 'NO'
			elif R >= 1 and L >= 1:
				pass
			else:
				return 'NO'
		if D == n:
			if U == n:
				if R >= 2 and L >= 2:
					pass
				else:
					return 'NO'
			elif U == n - 1:
				if R >= 2 and L >= 1 or (L >= 2 and R >= 1):
					pass
				else:
					return 'NO'
			elif R >= 1 and L >= 1:
				pass
			else:
				return 'NO'
		if L == n:
			if R == n:
				if D >= 2 and U >= 2:
					pass
				else:
					return 'NO'
			elif R == n - 1:
				if D >= 2 and U >= 1 or (U >= 2 and D >= 1):
					pass
				else:
					return 'NO'
			elif D >= 1 and U >= 1:
				pass
			else:
				return 'NO'
		if R == n:
			if L == n:
				if D >= 2 and U >= 2:
					pass
				else:
					return 'NO'
			elif L == n - 1:
				if D >= 2 and U >= 1 or (U >= 2 and D >= 1):
					pass
				else:
					return 'NO'
			elif D >= 1 and U >= 1:
				pass
			else:
				return 'NO'
	else:
		if U == n - 1:
			if D == n - 1:
				if R >= 2 or L >= 2 or (R >= 1 and L >= 1):
					pass
				else:
					return 'NO'
			elif R >= 1 or L >= 1:
				pass
			else:
				return 'NO'
		if D == n - 1:
			if U == n - 1:
				if R >= 2 or L >= 2 or (R >= 1 and L >= 1):
					pass
				else:
					return 'NO'
			elif R >= 1 or L >= 1:
				pass
			else:
				return 'NO'
		if R == n - 1:
			if L == n - 1:
				if U >= 2 or D >= 2 or (U >= 1 and D >= 1):
					pass
				else:
					return 'NO'
			elif U >= 1 or D >= 1:
				pass
			else:
				return 'NO'
		if L == n - 1:
			if R == n - 1:
				if U >= 2 or D >= 2 or (U >= 1 and D >= 1):
					pass
				else:
					return 'NO'
			elif U >= 1 or D >= 1:
				pass
			else:
				return 'NO'
	return 'YES'
t = int(input())
for _ in range(t):
	(n, U, R, D, L) = [int(i) for i in input().strip().split()]
	print(ans(n, U, R, D, L))


import sys
input = sys.stdin.readline

def solve():
	arr = list(map(int, input().split()))
	n = arr[0]
	arr = arr[1:]
	for i in range(16):
		f = False
		board = [0, 0, 0, 0]
		for j in range(4):
			if i & 1:
				board[j] += 1
			i >>= 1
		for k in range(4):
			(l, r) = (board[k], board[(k + 1) % 4])
			m = arr[k] - (l + r)
			if m < 0 or m > n - 2:
				f = True
				break
		if not f:
			return 'YES'
	return 'NO'
for _ in range(int(input())):
	print(solve())


t = int(input())
ans = ['NO'] * t
for _ in range(t):
	(n, u, r, d, l) = list(map(int, input().split()))
	data = [u, r, d, l]
	if u <= n - 2 and r <= n - 2 and (d <= n - 2) and (l <= n - 2):
		ans[_] = 'YES'
		continue
	more = [u - (n - 2), r - (n - 2), d - (n - 2), l - (n - 2)]
	linker = [(3, 1), (0, 2), (1, 3), (2, 0)]
	for g in range(16):
		moreSides = [0, 0, 0, 0]
		gCopy = g
		for iter in range(4):
			if more[iter] == 1:
				moreSides[linker[iter][gCopy % 2]] += 1
			gCopy //= 2
		for i in range(4):
			if more[i] == 2:
				moreSides[linker[i][0]] += 1
				moreSides[linker[i][1]] += 1
		fl = True
		for i in range(4):
			if moreSides[i] > data[i]:
				fl = False
				break
		if fl:
			ans[_] = 'YES'
			break
print(*ans, sep='\n')


for _ in range(int(input())):
	(n, u, l, d, r) = map(int, input().split())
	for i in range(16):
		b = [i >> j & 1 for j in range(4)]
		nu = u - b[0] - b[3]
		nl = l - b[0] - b[1]
		nd = d - b[1] - b[2]
		nr = r - b[2] - b[3]
		if nu >= 0 <= nl and nd >= 0 <= nr and (nu <= n - 2 >= nl) and (nd <= n - 2 >= nr):
			print('YES')
			break
	else:
		print('NO')


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
inp = lambda : list(map(int, sys.stdin.readline().rstrip('\r\n').split()))
mod = 10 ** 9 + 7
Mod = 998244353
INF = float('inf')
tc = 1
(tc,) = inp()
for _ in range(tc):
	(n, uu, rr, dd, ll) = inp()
	f = False

	def c(num):
		return num >= 0 and num <= n - 2
	for i in range(16):
		(u, r, d, l) = (uu, rr, dd, ll)
		if i & 8:
			u -= 1
			l -= 1
		if i & 4:
			u -= 1
			r -= 1
		if i & 2:
			r -= 1
			d -= 1
		if i & 1:
			d -= 1
			l -= 1
		if all(map(c, [u, r, d, l])):
			f = True
	print('YES' if f else 'NO')


def solve():
	(n, u, r, b, l) = map(int, input().split())
	for m in range(16):
		(ua, ra, ba, la) = (u, r, b, l)
		if m % 2:
			ua -= 1
			ra -= 1
		m //= 2
		if m % 2:
			ra -= 1
			ba -= 1
		m //= 2
		if m % 2:
			ba -= 1
			la -= 1
		m //= 2
		if m % 2:
			la -= 1
			ua -= 1
		if ua in range(n - 1) and ra in range(n - 1) and (ba in range(n - 1)) and (la in range(n - 1)):
			print('YES')
			return
	print('NO')
tests = int(input())
for test in range(tests):
	solve()


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
from itertools import permutations
I = sys.stdin.readline

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

def mi():
	return map(int, I().strip().split())

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	elif n <= 2:
		return True
	else:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				return False
		return True

def main():
	ans = ''
	for _ in range(ii()):
		(n, u, r, d, l) = mi()
		tmp = 'NO'
		for i in range(16):
			u1 = u
			r1 = r
			d1 = d
			l1 = l
			if i & 1:
				u1 -= 1
				l1 -= 1
			if i & 2:
				u1 -= 1
				r1 -= 1
			if i & 4:
				d1 -= 1
				r1 -= 1
			if i & 8:
				l1 -= 1
				d1 -= 1
			s = [u1, r1, d1, l1]
			flag = 1
			for j in s:
				if j < 0 or j > n - 2:
					flag = 0
			if flag:
				tmp = 'YES'
		ans += tmp + '\n'
	print(ans)
main()


import math
import sys
import collections
import bisect
import heapq
testcases = int(sys.stdin.readline())
for _ in range(testcases):
	arr = list(map(int, sys.stdin.readline().strip().split()))
	n = arr[0]
	U = arr[1]
	R = arr[2]
	D = arr[3]
	L = arr[4]
	corners = [-1, -1, -1, -1]
	ins = n - 2
	res = False
	for c1 in (1, 0):
		for c2 in (1, 0):
			for c3 in (1, 0):
				for c4 in (1, 0):
					corners = [c1, c2, c3, c4]
					r = True
					for (ind, i) in enumerate((U, R, D, L)):
						if i == 0:
							if corners[ind] == 1 or corners[ind - 1] == 1:
								r = False
						elif i == 1:
							if corners[ind] == 1 and corners[ind - 1] == 1:
								r = False
						if i == n:
							if corners[ind] == 0 or corners[ind - 1] == 0:
								r = False
						if i == n - 1:
							if corners[ind] == 0 and corners[ind - 1] == 0:
								r = False
					if r:
						res = True
	if res:
		print('YES')
	else:
		print('NO')


uc = 0
rc = 0
dc = 0
lc = 0
j = int(input())
for i in range(j):
	(n, u, r, d, l) = map(int, input().split())
	uc = u
	rc = r
	dc = d
	lc = l
	if u == n:
		rc -= 1
		lc -= 1
	if r == n:
		uc -= 1
		dc -= 1
	if l == n:
		uc -= 1
		dc -= 1
	if d == n:
		rc -= 1
		lc -= 1
	if u == n - 1:
		if lc > rc:
			lc -= 1
		else:
			rc -= 1
	if d == n - 1:
		if lc > rc:
			lc -= 1
		else:
			rc -= 1
	if r == n - 1:
		if uc > dc:
			uc -= 1
		else:
			dc -= 1
	if l == n - 1:
		if uc > dc:
			uc -= 1
		else:
			dc -= 1
	if uc < 0 or dc < 0 or lc < 0 or (rc < 0):
		print('NO')
	else:
		print('YES')


import math

def solve(inp):
	(n, u, r, d, l) = list(map(int, inp.split()))
	for i in range(16):
		(cu, cr, cd, cl) = (u, r, d, l)
		if i & 1:
			cu -= 1
			cr -= 1
		if i & 2:
			cr -= 1
			cd -= 1
		if i & 4:
			cd -= 1
			cl -= 1
		if i & 8:
			cl -= 1
			cu -= 1
		if min(cu, cr, cd, cl) >= 0 and max(cu, cr, cd, cl) <= n - 2:
			return 'YES'
	return 'NO'
tc = int(input())
for _ in range(tc):
	inp = input()
	print(solve(inp))


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 998244353
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]

def ok(x):
	x = [int(i) for i in bin(x)[2:]]
	x = [0] * (4 - len(x)) + x
	(u, r, d, l) = (U, R, D, L)
	if x[0]:
		u -= 1
		l -= 1
	if x[1]:
		u -= 1
		r -= 1
	if x[2]:
		l -= 1
		d -= 1
	if x[3]:
		r -= 1
		d -= 1
	for i in (u, r, d, l):
		if i < 0 or i > n - 2:
			return False
	return True
for _ in range(Int()):
	(n, U, R, D, L) = value()
	ans = 'NO'
	for i in range(16):
		if ok(i):
			ans = 'YES'
	print(ans)