Polycarp has a string $s[1 \dots n]$ of length $n$ consisting of decimal digits. Polycarp performs the following operation with the string $s$ no more than once (i.e. he can perform operation $0$ or $1$ time):

Polycarp selects two numbers $i$ and $j$ ($1 \leq i \leq j \leq n$) and removes characters from the $s$ string at the positions $i, i+1, i+2, \ldots, j$ (i.e. removes substring $s[i \dots j]$). More formally, Polycarp turns the string $s$ into the string $s_1 s_2 \ldots s_{i-1} s_{j+1} s_{j+2} \ldots s_{n}$.

For example, the string $s = $"20192020" Polycarp can turn into strings:

"2020" (in this case $(i, j)=(3, 6)$ or $(i, j)=(1, 4)$);

"2019220" (in this case $(i, j)=(6, 6)$);

"020" (in this case $(i, j)=(1, 5)$);

other operations are also possible, only a few of them are listed above.

Polycarp likes the string "2020" very much, so he is wondering if it is possible to turn the string $s$ into a string "2020" in no more than one operation? Note that you can perform zero operations.


-----Input-----

The first line contains a positive integer $t$ ($1 \leq t \leq 1000 $) — number of test cases in the test. Then $t$ test cases follow.

The first line of each test case contains an integer $n$ ($4 \leq n \leq 200$) — length of the string $s$. The next line contains a string $s$ of length $n$ consisting of decimal digits. It is allowed that the string $s$ starts with digit 0.


-----Output-----

For each test case, output on a separate line:

"YES" if Polycarp can turn the string $s$ into a string "2020" in no more than one operation (i.e. he can perform $0$ or $1$ operation);

"NO" otherwise.

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


-----Examples-----

Input
6
8
20192020
8
22019020
4
2020
5
20002
6
729040
6
200200
Output
YES
YES
YES
NO
NO
NO


-----Note-----

In the first test case, Polycarp could choose $i=3$ and $j=6$.

In the second test case, Polycarp could choose $i=2$ and $j=5$.

In the third test case, Polycarp did not perform any operations with the string.

Difficulty: EASY

Solutions:
for _ in range(int(input())):
	n = int(input())
	s = input()
	count = 0
	if s[0:0 + 4] == '2020' or s[n - 4:n] == '2020':
		print('YES')
	elif s[0:2] == '20' and s[n - 2:n] == '20':
		print('YES')
	elif s[0:1] == '2' and s[n - 3:n] == '020':
		print('YES')
	elif s[0:3] == '202' and s[n - 1:n] == '0':
		print('YES')
	else:
		print('NO')


def solve(s):
	if '2020' in s[:4] or '2020' in s[-4:]:
		return 'YES'
	for i in range(1, 4):
		if '2020' in s[:4 - i] + s[-i:]:
			return 'YES'
	return 'NO'
t = int(input())
for i in range(0, t):
	n = int(input())
	s = input()
	print(solve(s[:n]))


test_cases = int(input())
for case in range(test_cases):
	length_of_string = int(input())
	input_string = input()
	if input_string[:4] == '2020':
		print('YES')
	elif input_string[:3] == '202' and input_string[-1:] == '0':
		print('YES')
	elif input_string[:2] == '20' and input_string[-2:] == '20':
		print('YES')
	elif input_string[:1] == '2' and input_string[-3:] == '020':
		print('YES')
	elif input_string[-4:] == '2020':
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	number = input()
	if number[-4:] == '2020' or number[:4] == '2020':
		print('YES')
	elif number[0] == '2' and number[-3:] == '020':
		print('YES')
	elif number[:3] == '202' and number[-1] == '0':
		print('YES')
	elif number[:2] == '20' and number[-2:] == '20':
		print('YES')
	else:
		print('NO')


import io
import os
from collections import Counter, defaultdict, deque

def solve(N, S):
	T = '2020'
	i = 0
	while i < 4 and S[i] == T[i]:
		i += 1
	j = 0
	while j < 4 and S[len(S) - 1 - j] == T[len(T) - 1 - j]:
		j += 1
	if i + j >= 4:
		return 'YES'
	return 'NO'
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = int(input())
for tc in range(1, TC + 1):
	(N,) = [int(x) for x in input().split()]
	S = input().decode().rstrip()
	ans = solve(N, S)
	print(ans)


import sys
T = int(sys.stdin.readline())
for i in range(T):
	N = int(sys.stdin.readline())
	num = str(sys.stdin.readline().strip())
	if '2020' in num[0:4] or '2020' in num[-4:]:
		print('YES')
	elif '20' in num[:2] and '20' in num[-2:]:
		print('YES')
	elif '2' in num[0] and '020' in num[-3:]:
		print('YES')
	elif '202' in num[:3] and '0' in num[-1]:
		print('YES')
	else:
		print('NO')


def newyear(n, s):
	if len(s) == 4 and s == '2020':
		print('YES')
		return None
	temp = -1
	tt = '2020'
	for i in range(4):
		if s[i] != tt[i]:
			break
		temp = i
	if temp == -1:
		temp = 0
	else:
		temp += 1
	tt2 = '0202'
	temp2 = 0
	for i in range(n - 1, n - 1 - 4, -1):
		if s[i] != tt2[temp2]:
			break
		temp2 += 1
	if temp + temp2 >= 4:
		print('YES')
	else:
		print('NO')
for _ in range(int(input())):
	n = int(input())
	number = input().strip()
	newyear(n, number)


def solution():
	x = int(input())
	string = input()
	if x == 4 and string == '2020':
		return 'YES'
	elif string[0] == '2' and string[1] == '0' and (string[2] == '2') and (string[3] == '0') or (string[x - 4] == '2' and string[x - 3] == '0' and (string[x - 2] == '2') and (string[x - 1] == '0')) or (string[0] == '2' and string[1] == '0' and (string[x - 2] == '2') and (string[x - 1] == '0')) or (string[0] == '2' and string[x - 3] == '0' and (string[x - 2] == '2') and (string[x - 1] == '0')) or (string[0] == '2' and string[1] == '0' and (string[2] == '2') and (string[x - 1] == '0')):
		return 'YES'
	else:
		return 'NO'
n = int(input())
for i in range(n):
	print(solution())


t = int(input())
for k in range(t):
	n = int(input())
	s = input()
	k = 0
	if s[0] == '2':
		if s[1] == '0':
			if s[2] == '2':
				if s[3] == '0':
					k = 1
				elif s[n - 1] == '0':
					k = 1
			elif s[n - 2] == '2':
				if s[n - 1] == '0':
					k = 1
		elif s[n - 3] == '0':
			if s[n - 2] == '2':
				if s[n - 1] == '0':
					k = 1
	elif s[n - 4] == '2':
		if s[n - 3] == '0':
			if s[n - 2] == '2':
				if s[n - 1] == '0':
					k = 1
	if k:
		print('YES')
	else:
		print('NO')


t = int(input())
result = []
for i in range(0, t):
	n = int(input())
	a = str(input())
	if a.startswith('2020'):
		result.append('YES')
	elif a.endswith('2020'):
		result.append('YES')
	elif a.startswith('20') and a.endswith('20'):
		result.append('YES')
	elif a.startswith('2') and a.endswith('020'):
		result.append('YES')
	elif a.startswith('202') and a.endswith('0'):
		result.append('YES')
	else:
		result.append('NO')
print('\n'.join(result))


x = int(input())
while x > 0:
	n = int(input())
	s = input()
	if s == '2020':
		print('YES')
	elif s[:4] == '2020':
		print('YES')
	elif s[-4:] == '2020':
		print('YES')
	elif s[:2] + s[-2:] == '2020':
		print('YES')
	elif s[:1] + s[-3:] == '2020':
		print('YES')
	elif s[:3] + s[-1:] == '2020':
		print('YES')
	else:
		print('NO')
	x -= 1


for t in range(int(input())):
	n = int(input())
	s = input()
	lst = [s[:4], s[:3] + s[-1], s[:2] + s[-2:], s[0] + s[-3:], s[-4:]]
	if '2020' in lst:
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	n = int(input())
	s = input()
	pos = False
	for i in range(5):
		if s[0:i] + s[n - 4 + i:n] == '2020':
			pos = True
			break
	print('YES' if pos else 'NO')


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

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

def I():
	return int(input())

def S():
	return str(input())
for _ in range(I()):
	l = I()
	s = S()
	fl = False
	for i in range(5):
		if i - 1 < l and l - 4 + i >= 0 and (s[0:i] + s[l - 4 + i:l] == '2020'):
			print('YES')
			fl = True
			break
	if not fl:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	a = input()
	if a[0] + a[n - 3] + a[n - 2] + a[n - 1] == '2020' or a[0] + a[1] + a[n - 2] + a[n - 1] == '2020' or a[0] + a[1] + a[2] + a[3] == '2020' or (a[0] + a[1] + a[2] + a[n - 1] == '2020') or (a[n - 4] + a[n - 3] + a[n - 2] + a[n - 1] == '2020'):
		print('YES')
	else:
		print('NO')


import math
import sys

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

def solve():
	n = Read.int()
	s = Read.string()
	t = '2020'
	d = 0
	for i in range(4):
		if t[i] == s[i]:
			d += 1
		else:
			break
	for i in range(4):
		if t[3 - i] == s[n - i - 1]:
			d += 1
		else:
			break
	print('YES' if d >= 4 else 'NO')
query_count = Read.int()
while query_count:
	query_count -= 1
	solve()


t = int(input())
while t > 0:
	t -= 1
	a = []
	n = int(input())
	a[:0] = input()
	if a[0] == '2' and a[1] == '0' and (a[2] == '2') and (a[3] == '0'):
		print('YES')
		continue
	if a[0] == '2' and a[1] == '0' and (a[2] == '2') and (a[n - 1] == '0'):
		print('YES')
		continue
	if a[0] == '2' and a[1] == '0' and (a[n - 2] == '2') and (a[n - 1] == '0'):
		print('YES')
		continue
	if a[0] == '2' and a[n - 3] == '0' and (a[n - 2] == '2') and (a[n - 1] == '0'):
		print('YES')
		continue
	if a[n - 4] == '2' and a[n - 3] == '0' and (a[n - 2] == '2') and (a[n - 1] == '0'):
		print('YES')
		continue
	print('NO')


n1 = int(input())
for i in range(n1):
	n = int(input())
	s = input()
	k = -1
	for i in range(5):
		j = 4 - i
		if s[0:i] + s[n - j:] == '2020':
			k = 1
			break
	if k > 0:
		print('YES')
	else:
		print('NO')


from sys import stdin
from sys import stdout
from math import *
for __ in range(int(input())):
	n = int(input())
	s = input()
	ans = 'NO'
	if s[:4] == '2020' or s[n - 4:] == '2020':
		ans = 'YES'
	elif s[0] == '2' and s[n - 3:] == '020':
		ans = 'YES'
	elif s[:2] == '20' and s[n - 2:] == '20':
		ans = 'YES'
	elif s[:3] == '202' and s[-1] == '0':
		ans = 'YES'
	elif s == '2020':
		ans = 'YES'
	print(ans)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	s = input()
	if ' '.join(s[:4].split()) == '2020' or ' '.join(s[-5:].split()) == '2020':
		print('YES')
		continue
	f = 0
	for i in range(5):
		if ' '.join(s[:i + 1].split()) + ' '.join(s[i - 4:].split()) == '2020':
			print('YES')
			f = 1
			break
	if f:
		continue
	print('NO')


def acharstring(s, n):
	for i in range(5):
		if s[:i] + s[n - 4 + i:] == '2020':
			print('YES')
			return
	print('NO')
for teste in range(int(input())):
	tamanho = int(input())
	string = input()
	acharstring(string, tamanho)


for _ in range(int(input())):
	n = int(input())
	s = input()
	idx = [(0, 1, 2, 3), (0, 1, 2, -1), (0, 1, -2, -1), (0, -3, -2, -1), (-4, -3, -2, -1)]
	flag = False
	for id in idx:
		temp = ''
		for _ in id:
			temp += s[_]
		if temp == '2020':
			print('YES')
			flag = True
			break
	if not flag:
		print('NO')


t = int(input())
while t:
	n = int(input())
	s = input()
	if s.startswith('2020') or s.endswith('2020') or (s.startswith('2') and s.endswith('020')) or (s.startswith('20') and s.endswith('20')) or (s.startswith('202') and s.endswith('0')):
		print('YES')
	else:
		print('NO')
	t -= 1


y = '2020'
t = int(input())
for i in range(t):
	input()
	s = input()
	if s[:4] == y or s[:1] + s[-3:] == y or s[:2] + s[-2:] == y or (s[:3] + s[-1:] == y) or (s[-4:] == y):
		print('YES')
	else:
		print('NO')


t = int(input())
for x in range(t):
	n = int(input())
	s = input()
	p = 'NO'
	if s[-2:] == '20' and s[:2] == '20':
		p = 'YES'
	if s[-3:] == '020' and s[0] == '2':
		p = 'YES'
	if s[-1] == '0' and s[:3] == '202':
		p = 'YES'
	if s[-4:] == '2020':
		p = 'YES'
	if s[:4] == '2020':
		p = 'YES'
	print(p)


from math import ceil, e
from math import sqrt, gcd
import sys
alnum = {i: chr(j) for (i, j) in zip(range(1, 27), range(97, 123))}
al = 'abcdefghijklmnopqrstuvwxyz'
q = lambda : map(int, input().split())
qi = lambda : int(input())
qs = lambda : input().split()
for _ in [0] * qi():
	(n,) = q()
	a = input()
	if a.startswith('2020') or a.endswith('2020'):
		print('YES')
	elif a.startswith('20') and a.endswith('20'):
		print('YES')
	elif a.startswith('2') and a.endswith('020'):
		print('YES')
	elif a.startswith('202') and a.endswith('0'):
		print('YES')
	else:
		print('NO')


def solve(n, s):
	if s[0:4] == '2020' or s[n - 4:] == '2020':
		return 'YES'
	if s[0:3] == '202' and s[n - 1] == '0':
		return 'YES'
	if s[0:2] == '20' and s[n - 2:] == '20':
		return 'YES'
	if s[0] == '2' and s[n - 3:] == '020':
		return 'YES'
	return 'NO'
t = int(input())
while t:
	n = int(input())
	s = input()
	print(solve(n, s))
	t -= 1


n = int(input())
for i in range(n):
	q = int(input())
	s = input()
	n = len(s)
	if s[0] == '2' and s[1] == '0' and (s[2] == '2') and (s[3] == '0'):
		print('YES')
	elif s[0] == '2' and s[1] == '0' and (s[2] == '2') and (s[-1] == '0'):
		print('YES')
	elif s[0] == '2' and s[1] == '0' and (s[n - 2] == '2') and (s[n - 1] == '0'):
		print('YES')
	elif s[0] == '2' and s[n - 3] == '0' and (s[n - 2] == '2') and (s[n - 1] == '0'):
		print('YES')
	elif s[n - 4] == '2' and s[n - 3] == '0' and (s[n - 2] == '2') and (s[n - 1] == '0'):
		print('YES')
	else:
		print('NO')


import sys
from functools import reduce
from collections import Counter
import time
import datetime
import math

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

def sip():
	return input()

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

def mips():
	return map(str, sys.stdin.readline().split())

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

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.insert(i, arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
t = ip()
while t:
	t -= 1
	n = ip()
	s = sip()
	if s[0] == '2' and s[1] == '0' and (s[2] == '2') and (s[3] == '0'):
		print('YES')
	elif s[-1] == '0' and s[-2] == '2' and (s[-3] == '0') and (s[-4] == '2'):
		print('YES')
	elif s[0] == '2' and s[-1] == '0' and (s[-2] == '2') and (s[-3] == '0'):
		print('YES')
	elif s[0] == '2' and s[1] == '0' and (s[-1] == '0') and (s[-2] == '2'):
		print('YES')
	elif s[0] == '2' and s[1] == '0' and (s[2] == '2') and (s[-1] == '0'):
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	s = str(input())
	if s[0:4] == '2020' or s[-1:-5:-1] == '0202' or (s[0:2] == '20' and s[-1:-3:-1] == '02'):
		print('YES')
	elif s[0] == '2' and s[-1:-4:-1] == '020' or (s[0:3] == '202' and s[-1] == '0'):
		print('YES')
	else:
		print('NO')


def solve():
	n = int(input())
	s = input()
	target = '2020'
	if s[:4] == '2020' or s[-4:] == '2020':
		print('YES')
	else:
		for i in range(4):
			if s[:i] == target[:i] and s[i - 4:] == target[i - 4:]:
				print('YES')
				return
		print('NO')

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


t = int(input())
for j in range(t):
	tmp = 0
	n = int(input())
	s = input()
	p = True
	if s[n - 1] == '0' and p:
		tmp += 1
	else:
		p = False
	if s[n - 2] == '2' and p:
		tmp += 1
	else:
		p = False
	if s[n - 3] == '0' and p:
		tmp += 1
	else:
		p = False
	if s[n - 4] == '2' and p:
		tmp += 1
	else:
		p = False
	if tmp == 4:
		print('YES')
		continue
	else:
		p = True
		if s[0] == '2' and p:
			tmp += 1
		else:
			p = False
		if s[1] == '0' and p and (tmp < 4):
			tmp += 1
		else:
			p = False
		if s[2] == '2' and p and (tmp < 4):
			tmp += 1
		else:
			p = False
		if s[3] == '0' and p and (tmp < 4):
			tmp += 1
		else:
			p = False
	if tmp == 4:
		print('YES')
	else:
		print('NO')


T = int(input())
for t in range(T):
	n = int(input())
	s = input()
	if s == '2020' or s[:4] == '2020' or s[-4:] == '2020':
		print('YES')
	else:
		lst = [('2', '020'), ('20', '20'), ('202', '0')]
		if s[0] == '2' and s[-3:] == '020' or (s[:2] == '20' and s[-2:] == '20') or (s[:3] == '202' and s[-1:] == '0'):
			print('YES')
		else:
			print('NO')


for ii in range(int(input())):
	n = int(input())
	s = input()
	if n < 4:
		print('NO')
		continue
	flag = 0
	if s[0:4] == '2020':
		flag = 1
	if s[0] == '2' and s[-3:] == '020':
		flag = 1
	if s[0:2] == '20' and s[-2:] == '20':
		flag = 1
	if s[0:3] == '202' and s[-1] == '0':
		flag = 1
	if s[-4:] == '2020':
		flag = 1
	if flag == 1:
		print('YES')
	else:
		print('NO')


import time, math as mt, bisect as bs, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

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

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

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

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

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

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

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def readTree(n, e):
	adj = [set() for i in range(n + 1)]
	for i in range(e):
		(u1, u2) = IP()
		adj[u1].add(u2)
	return adj

def sieve():
	li = [True] * (10 ** 3 + 5)
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	(prime, cur) = ([0] * 200, 0)
	for i in range(10 ** 3 + 5):
		if li[i] == True:
			prime[cur] = i
			cur += 1
	return prime

def SPF():
	mx = 10 ** 6 + 1
	spf[1] = 1
	for i in range(2, mx):
		if spf[i] == 1000000000.0:
			spf[i] = i
			for j in range(i * i, mx, i):
				if i < spf[j]:
					spf[j] = i
	return

def prime(n, d):
	prm = set()
	while n != 1:
		prm.add(spf[n])
		n = n // spf[n]
	for ele in prm:
		d[ele] = d.get(ele, 0) + 1
	return
mod = 998244353

def solve():
	n = II()
	s = stdin.readline()
	s = s[:n]
	if s[0] == '2' and s[1] == '0' and (s[-2] == '2') and (s[-1] == '0'):
		print('YES')
		return
	elif s[0] == '2' and s[-3] == '0' and (s[-2] == '2') and (s[-1] == '0'):
		print('YES')
		return
	elif s[-4] == '2' and s[-3] == '0' and (s[-2] == '2') and (s[-1] == '0'):
		print('YES')
		return
	elif s[0] == '2' and s[1] == '0' and (s[2] == '2') and (s[-1] == '0'):
		print('YES')
		return
	elif s[0] == '2' and s[1] == '0' and (s[2] == '2') and (s[3] == '0'):
		print('YES')
		return
	print('NO')
	return
t = II()
for i in range(t):
	solve()


t = int(input())
for i in range(t):
	l = int(input())
	s = str(input())
	if s[0:4] == '2020' or s[-4:] == '2020':
		print('YES')
	elif s[0] == '2' and s[-3:] == '020' or (s[-1] == '0' and s[0:3] == '202'):
		print('YES')
	elif s[0:2] == '20' and s[-2:] == '20':
		print('YES')
	else:
		print('NO')


n = int(input(''))
for i in range(n):
	a = int(input(''))
	t = input('')
	if t[0] + t[1] + t[2] + t[3] == '2020' or t[len(t) - 4] + t[len(t) - 3] + t[len(t) - 2] + t[len(t) - 1] == '2020':
		print('YES')
	else:
		t1 = ''
		d = '2020'
		for i in range(4):
			if t[i] == d[i]:
				t1 += d[i]
			else:
				break
		if t1 + t[a - (4 - len(t1)):] == '2020':
			print('YES')
		else:
			print('NO')


import sys, io, os, math
from math import ceil, log

def printlist(n):
	sys.stdout.write(' '.join(map(str, n)) + '\n')

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

def printns(n):
	sys.stdout.write(str(n))

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

def strinp():
	return sys.stdin.readline()

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

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

def flush():
	return stdout.flush()

def power_two(x):
	return 1 << x

def solve():
	n = intinp()
	s = input()
	if s[-1] == '0' and s[-2] == '2' and (s[-3] == '0') and (s[-4] == '2'):
		print('YES')
		return
	if s[0] == '2' and s[-1] == '0' and (s[-2] == '2') and (s[-3] == '0'):
		print('YES')
		return
	if s[0] == '2' and s[1] == '0' and (s[2] == '2') and (s[3] == '0'):
		print('YES')
		return
	if s[0] == '2' and s[1] == '0' and (s[-2] == '2') and (s[-1] == '0'):
		print('YES')
		return
	if s[0] == '2' and s[1] == '0' and (s[2] == '2') and (s[-1] == '0'):
		print('YES')
		return
	else:
		print('NO')
		return

def main():
	tc = intinp()
	for _ in range(0, tc):
		solve()
main()


for _ in range(int(input())):
	length = int(input())
	A = input()
	string = '2020'
	if A[0:4] == '2020' or A[length - 4:length] == '2020' or A[0] + A[1] + A[-2] + A[-1] == '2020' or (A[0] + A[-3] + A[-2] + A[-1] == '2020') or (A[0] + A[1] + A[2] + A[-1] == '2020') or (A[0] + A[-3] + A[-2] + A[-1] == '2020'):
		print('YES')
	else:
		print('NO')


t = int(input())
i = 0
while i < t:
	n = int(input())
	s = input()
	i += 1
	if s[n - 4:] == '2020' or s[0:4] == '2020':
		print('YES')
		continue
	if s[0] == '2' and s[n - 3:] == '020':
		print('YES')
		continue
	if s[0:2] == '20' and s[n - 2:] == '20':
		print('YES')
		continue
	if s[0:3] == '202' and s[n - 1:] == '0':
		print('YES')
		continue
	print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	p = 0
	if (s[n - 3:n - 1] == '02' or (s[1] == '0' and s[-2] == '2') or s[1:3] == '02') and (s[0] == '2' and s[-1] == '0'):
		print('YES')
	elif s[:4] == '2020' or s[n - 4:] == '2020':
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(0, t):
	n = int(input())
	s = str(input())
	s1 = s[0] + s[-3:]
	flag = False
	if s1 == '2020':
		flag = True
	s1 = s[:2] + s[-2:]
	if s1 == '2020':
		flag = True
	s1 = s[:3] + s[-1:]
	if s1 == '2020':
		flag = True
	s1 = s[:4]
	if s1 == '2020':
		flag = True
	s1 = s[-4:]
	if s1 == '2020':
		flag = True
	if flag:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	ss = '2020'
	i = 0
	while i < 4 and s[i] == ss[i]:
		i += 1
	if s.endswith(ss[i:]):
		print('YES')
	else:
		print('NO')


for x in range(int(input())):
	n = int(input())
	s = input()
	if s[0] + s[1] + s[2] + s[3] == '2020':
		print('YES')
	elif s[0] + s[1] + s[2] + s[n - 1] == '2020':
		print('YES')
	elif s[0] + s[1] + s[n - 2] + s[n - 1] == '2020':
		print('YES')
	elif s[0] + s[n - 3] + s[n - 2] + s[n - 1] == '2020':
		print('YES')
	elif s[n - 4] + s[n - 3] + s[n - 2] + s[n - 1] == '2020':
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	flag = 0
	if s[0] == '2' and s[n - 1] == '0' and (s[n - 2] == '2') and (s[n - 3] == '0'):
		flag = 1
	if s[0] == '2' and s[n - 1] == '0' and (s[n - 2] == '2') and (s[1] == '0'):
		flag = 1
	if s[0] == '2' and s[1] == '0' and (s[2] == '2') and (s[n - 1] == '0'):
		flag = 1
	if s[0] == '2' and s[3] == '0' and (s[2] == '2') and (s[1] == '0'):
		flag = 1
	if s[n - 4] == '2' and s[n - 1] == '0' and (s[n - 2] == '2') and (s[n - 3] == '0'):
		flag = 1
	if flag == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
tmp = []
for i in range(t):
	n = int(input())
	s = input()
	if n == 4:
		if s == '2020':
			tmp.append(1)
		else:
			tmp.append(0)
	elif s[-4:] == '2020' or (s[0] == '2' and s[-3:] == '020') or (s[0:2] == '20' and s[-2:] == '20') or (s[0:3] == '202' and s[-1] == '0') or (s[0:4] == '2020'):
		tmp.append(1)
	else:
		tmp.append(0)
for e in tmp:
	if e:
		print('YES')
	else:
		print('NO')


from sys import stdin, stdout
outputs = []
t = int(stdin.readline().strip())
for __ in range(int(t)):
	n = int(stdin.readline().strip())
	a = stdin.readline().strip()
	condn = False
	if a[0:4] == '2020':
		condn = True
	elif a[-4:] == '2020':
		condn = True
	elif a[0] == '2' and a[-3:] == '020':
		condn = True
	elif a[-1] == '0' and a[0:3] == '202':
		condn = True
	elif a[0:2] == '20' and a[-2:] == '20':
		condn = True
	if condn:
		outputs.append('YES')
	else:
		outputs.append('NO')
for output in outputs:
	stdout.write(output + '\n')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	if s[0:4] == '2020':
		print('YES')
		continue
	elif s[-4:] == '2020':
		print('YES')
		continue
	elif s[0:3] == '202':
		if s[-1] == '0':
			print('YES')
			continue
	elif s[-3:] == '020' and s[0] == '2':
		print('YES')
		continue
	elif s[0:2] == '20':
		if s[-2:] == '20':
			print('YES')
			continue
	print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	count = 'NO'
	string = n - 4
	for i in range(5):
		if s[:i] + s[i + string:] == '2020':
			count = 'YES'
	print(count)


nt = int(input())
for t in range(nt):
	n = int(input())
	s = input()
	t = '2020'
	yes = 0
	for i in range(4, -1, -1):
		if i == 0:
			if s[:4 - i] == t[:4 - i]:
				print('YES')
				yes = 1
				break
		elif i != 0:
			if s[:4 - i] + s[-i:] == t[:4 - i] + t[-i:]:
				print('YES')
				yes = 1
				break
	if not yes:
		print('NO')


def f(str1, l):
	k = l - 4
	for i in range(l - k + 1):
		if str1[:i] + str1[k + i:] == '2020':
			return True
	return False
n = int(input())
for i in range(n):
	le = int(input())
	print('YES' if f(input(), le) else 'NO')


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	req = '2020'
	count = 0
	for i in range(4):
		if s[i] == req[i]:
			count += 1
		else:
			break
	if s[n - (4 - count):n] == req[count:4]:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	a = input()
	if a == '2020':
		print('YES')
	else:
		flag = 0
		if a.startswith('2') and a.endswith('020') or (a.startswith('20') and a.endswith('20')) or (a.startswith('202') and a.endswith('0')) or a.startswith('2020') or a.endswith('2020'):
			flag = 1
		if flag == 1:
			print('YES')
		else:
			print('NO')


test = int(input())
for kl in range(test):
	l = int(input())
	x = input()
	if x[0] == '2' and x[len(x) - 1] == '0' and (x[len(x) - 2] == '2') and (x[len(x) - 3] == '0'):
		print('YES')
	elif x[0] == '2' and x[1] == '0' and (x[len(x) - 1] == '0') and (x[len(x) - 2] == '2'):
		print('YES')
	elif x[0] == '2' and x[1] == '0' and (x[2] == '2') and (x[len(x) - 1] == '0'):
		print('YES')
	elif x[0] == '2' and x[1] == '0' and (x[2] == '2') and (x[3] == '0') or (x[len(x) - 1] == '0' and x[len(x) - 2] == '2' and (x[len(x) - 3] == '0') and (x[len(x) - 4] == '2')):
		print('YES')
	else:
		print('NO')


def sol(arr):
	target = '2020'
	if arr[:4] == target:
		return True
	elif arr[:1] + arr[-3:] == target:
		return True
	elif arr[:2] + arr[-2:] == target:
		return True
	elif arr[:3] + arr[-1:] == target:
		return True
	elif arr[-4:] == target:
		return True
	return False
t = int(input())
for _ in range(t):
	n = int(input())
	arr = input()
	if sol(arr):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	possible = False
	for i in range(5):
		if s[:i] + s[n - 4 + i:] == '2020':
			possible = True
	print('YES') if possible else print('NO')


n = int(input())
for i in range(n):
	a = int(input())
	b = input()
	for i in range(5):
		ss = b[0:i] + b[a - 4 + i:a]
		if ss == '2020':
			print('YES')
			break
	else:
		print('NO')


import sys
input = sys.stdin.readline

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

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

def main():
	for _ in range(int(input())):
		n = int(input())
		s = input()
		if n < 4:
			print('NO')
			continue
		a = '2020'
		k = 0
		for i in range(n):
			if k > 3:
				break
			if a[k] == s[i]:
				k += 1
			else:
				break
		if k <= 3:
			rem = 4 - k
			if s[n - rem:n] == a[k:4]:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	return
main()


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	sub_str = '2020'
	s1 = s[:1] + s[-3:]
	s2 = s[:2] + s[-2:]
	s3 = s[:3] + s[-1:]
	s4 = s[:4]
	s5 = s[-4:]
	if s1 == '2020' or s2 == '2020' or s3 == '2020' or (s4 == '2020') or (s5 == '2020'):
		print('YES')
	else:
		print('NO')
	t -= 1


for _ in range(int(input())):
	n = int(input())
	s = input()
	if s.count('2') < 2 or s.count('0') < 2:
		print('NO')
	else:
		cntr = 0
		for i in range(n):
			for j in range(n):
				res = s[:i] + s[j + 1:]
				if res == '2020':
					cntr += 1
		if cntr == 0:
			print('NO')
		else:
			print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	s = str(input())
	if s == '2020':
		print('YES')
		continue
	m = len(s) - 4
	flag = False
	for i in range(n - m + 1):
		t = s[0:i] + s[i + m:]
		if t == '2020':
			flag = True
			break
	if flag:
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	n = int(input())
	s = input()
	s1 = s[:4]
	s2 = s[-4:]
	if s1 == '2020' or s2 == '2020':
		print('YES')
		continue
	for i in range(4):
		s3 = s1[:i] + s2[i:]
		if s3 == '2020':
			print('YES')
			break
	else:
		print('NO')


from sys import stdin
inp = stdin.read()
lst = inp.split()
t = lst[0]
s = 1
while s in range(len(lst) - 1):
	n = int(lst[s])
	seq = lst[s + 1]
	s += 2
	if seq.find('2020') == 0 or seq.rfind('2020') == n - 4:
		print('YES')
	elif seq.find('202') == 0 and seq.rfind('0') == n - 1:
		print('YES')
	elif seq.find('2') == 0 and seq.rfind('020') == n - 3:
		print('YES')
	elif seq.find('20') == 0 and seq.rfind('20') == n - 2:
		print('YES')
	else:
		print('NO')


import sys
N = int(200000.0 + 5)
sys.setrecursionlimit(N)

def charming():
	n = int(input())
	s = input()
	for i in range(5):
		ns = s[0:i] + s[n - (4 - i):n]
		if ns == '2020':
			print('YES')
			return
	print('NO')
for t in range(int(input())):
	charming()


t = int(input())
for _ in range(t):
	(n, s) = (int(input()), input())
	yes = s[:4] == '2020'
	for i in range(0, 4):
		if s[:i] + s[-4 + i:] == '2020':
			yes = True
			break
	if yes:
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	t -= 1
	n = int(input())
	string = input()
	ans = False
	for i in range(0, 5):
		if string[0:i] + string[n - 4 + i:] == '2020':
			ans = True
			break
	if ans:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	t = True
	if s == '2020':
		t = False
	else:
		for i in range(n):
			j = i + n - 4
			x = s[:i] + s[j:]
			if x == '2020':
				t = False
				break
	if t:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	s = str(input())
	remove_digits = n - 4
	for ind in range(5):
		if s[:ind] + s[ind + remove_digits:] == '2020':
			print('YES')
			break
		elif ind == 4:
			print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	a = '2020'
	for i in range(5):
		if s.startswith(a[:i]) and s.endswith(a[i:]):
			print('YES')
			break
	else:
		print('NO')


def yes():
	print('YES')

def no():
	print('NO')

def solve():
	n = int(input())
	s = input()
	if n < 4:
		no()
	elif s[0:2] == '20' and s[n - 2:n] == '20':
		yes()
	elif s[:1] == '2' and s[n - 3:n] == '020':
		yes()
	elif s[:3] == '202' and s[-1] == '0':
		yes()
	elif s[n - 4:n] == '2020':
		yes()
	elif s[:4] == '2020':
		yes()
	else:
		no()
for testcase in range(int(input())):
	solve()


for _ in range(int(input())):
	n = int(input())
	s = input()
	b = 'NO'
	if s[:4] == '2020' or s[-4:] == '2020':
		b = 'YES'
	else:
		for i in range(1, 4):
			if s[:i] + s[i + n - 4:] == '2020':
				b = 'YES'
	print(b)


def solve(n, s):
	if n < 4:
		return False
	if s == '2020':
		return True
	if s[:2] == '20' and s[-2:] == '20':
		return True
	if s[0] == '2' and s[-3:] == '020':
		return True
	if s[:3] == '202' and s[-1] == '0':
		return True
	if s[:4] == '2020' or s[-4:] == '2020':
		return True
	return False
T = int(input())
for t in range(T):
	n = int(input())
	s = input()
	result = solve(n, s)
	print('YES' if result else 'NO')


while True:
	try:
		t = eval(input())
		for i in range(t):
			n = eval(input())
			str0 = input()
			if str0[0] == '2' and str0[1] == '0' and (str0[2] == '2') and (str0[3] == '0'):
				print('YES')
			elif str0[0] == '2' and str0[n - 3] == '0' and (str0[n - 2] == '2') and (str0[n - 1] == '0'):
				print('YES')
			elif str0[0] == '2' and str0[1] == '0' and (str0[n - 2] == '2') and (str0[n - 1] == '0'):
				print('YES')
			elif str0[0] == '2' and str0[1] == '0' and (str0[2] == '2') and (str0[n - 1] == '0'):
				print('YES')
			elif str0[n - 4] == '2' and str0[n - 3] == '0' and (str0[n - 2] == '2') and (str0[n - 1] == '0'):
				print('YES')
			else:
				print('NO')
	except:
		break


def main():
	tests = int(input())
	for _ in range(tests):
		s_len = int(input())
		s = input()
		if s[0] == '2' and s[s_len - 3:] == '020':
			print('YES')
			continue
		if s[:2] == '20' and s[s_len - 2:] == '20':
			print('YES')
			continue
		if s[:3] == '202' and s[s_len - 1] == '0':
			print('YES')
			continue
		if s[:4] == '2020' or s[s_len - 4:] == '2020':
			print('YES')
			continue
		print('NO')
main()


def solve():
	n = int(input())
	s = input()
	if s[:4] == '2020':
		return True
	if s[:3] + s[n - 1] == '2020':
		return True
	if s[:2] + s[n - 2:n] == '2020':
		return True
	if s[:1] + s[n - 3:n] == '2020':
		return True
	if s[n - 4:n] == '2020':
		return True
	return False
for _ in range(int(input())):
	if solve():
		print('YES')
	else:
		print('NO')


t = int(input())
while t > 0:
	n = int(input())
	s = input()
	l = len(s)
	if s[0:4] == '2020' or s[-4:] == '2020' or s[:] == '2020' or (s[0:2] == '20' and s[-2:] == '20') or (s[0] == '2' and s[-3:] == '020') or (s[0:3] == '202' and s[-1] == '0'):
		print('YES')
	else:
		print('NO')
	t -= 1


for sd in range(int(input())):
	x = input()
	b = input()
	if b == '2020':
		print('YES')
	elif b[0] + b[1] + b[2] + b[3] == '2020':
		print('YES')
	elif b[-4] + b[-3] + b[-2] + b[-1] == '2020':
		print('YES')
	elif b[0] == '2' and b[-3] + b[-2] + b[-1] == '020':
		print('YES')
	elif b[0] + b[1] == '20' and b[-2] + b[-1] == '20':
		print('YES')
	elif b[0] + b[1] + b[2] == '202' and b[-1] == '0':
		print('YES')
	else:
		print('NO')


test = int(input())
for sdfas in range(test):
	n = int(input())
	a = input()
	if a[:4] == '2020' or a[-4:] == '2020':
		print('YES')
	elif a[:3] == '202' and a[-1] == '0':
		print('YES')
	elif a[:2] == '20' and a[-2:] == '20':
		print('YES')
	elif a[:1] == '2' and a[-3:] == '020':
		print('YES')
	else:
		print('NO')


def testcase():
	n = int(input())
	s = input()
	ans = 'NO'
	if s == '2020':
		ans = 'YES'
	else:
		ns = s[:4]
		if ns == '2020':
			ans = 'YES'
		ns = s[:3] + s[-1:]
		if ns == '2020':
			ans = 'YES'
		ns = s[:2] + s[-2:]
		if ns == '2020':
			ans = 'YES'
		ns = s[:1] + s[-3:]
		if ns == '2020':
			ans = 'YES'
		ns = s[-4:]
		if ns == '2020':
			ans = 'YES'
	print(ans)
	return
import sys, os
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
sys.setrecursionlimit(10 ** 5)
t = int(input())
for _ in range(t):
	testcase()


for i in range(int(input())):
	(string_length, string) = (int(input()), input())
	for (first_slice_end, second_slice_start) in enumerate(range(string_length - 4, string_length + 1)):
		if string[:first_slice_end] + string[second_slice_start:] == '2020':
			print('YES')
			break
	else:
		print('NO')


import math

def func(a):
	n = len(a)
	k = 0
	x = '2020'
	for i in range(n):
		if k < 4 and a[i] == x[k]:
			k += 1
		else:
			break
	v = 3
	for j in range(n - 1, -1, -1):
		if v >= 0 and a[j] == x[v]:
			v -= 1
		else:
			break
	if k > v:
		return 'YES'
	else:
		return 'NO'
q = int(input())
for _ in range(q):
	n = int(input())
	a = input()
	print(func(a))


t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	index = 0
	a = '2020'
	for i in range(n):
		if s[i] == a[index]:
			index += 1
		else:
			break
		if index == 4:
			break
	if index == 4:
		print('YES')
	elif s[n - (4 - index):n] == a[index:4]:
		print('YES')
	else:
		print('NO')


cases = int(input())

def solve(s):
	arr = [s[:4], s[-4:], s[:1] + s[-3:], s[:2] + s[-2:], s[:3] + s[-1:]]
	return 'YES' if '2020' in arr else 'NO'
for _ in range(cases):
	n = int(input())
	print(solve(input()))


import math, sys, itertools
wtf = sys.stdin.read()
wtf = wtf.strip().split('\n')
for t in [wtf[i:i + 2] for i in range(1, len(wtf), 2)]:
	n = int(t[0])
	s = t[1]
	if s[0:4] == '2020':
		print('YES')
	elif s[-4:] == '2020':
		print('YES')
	elif s[0:2] == '20' and s[-2:] == '20':
		print('YES')
	elif s[0] == '2' and s[-3:] == '020':
		print('YES')
	elif s[0:3] == '202' and s[-1] == '0':
		print('YES')
	else:
		print('NO')


S = '2020'
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	flag = False
	for i in range(5):
		if s[:i] + s[n - 4 + i:n] == S:
			flag = True
			break
	if flag:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	num = input()
	for i in range(5):
		if num[0:i] + num[n - 4 + i:n] == '2020':
			print('YES')
			break
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	if s == '2020':
		print('YES')
	else:
		found = 0
		for i in range(n):
			for j in range(i, n):
				str = s[:i] + s[j + 1:]
				if str == '2020':
					print('YES')
					found = 1
					break
			if found == 1:
				break
		if found == 0:
			print('NO')


for _ in range(int(input())):
	n = int(input())
	s = input()
	flag = -1
	if s[0] == '2':
		flag = 3
		if s[1] == '0':
			flag = 2
			if s[2] == '2':
				flag = 1
				if s[3] == '0':
					flag = 0
	if flag == -1:
		if s[n - 4:] == '2020':
			print('YES')
		else:
			print('NO')
	else:
		temp = '2020'
		if flag == 0:
			print('YES')
		elif s[n - flag:] == temp[4 - flag:]:
			print('YES')
		else:
			print('NO')


def func(s):
	if s[0] == '2' and s[1] == '0' and (s[2] == '2') and (s[3] == '0'):
		return 'YES'
	if s[-1] == '0' and s[-2] == '2' and (s[-3] == '0') and (s[-4] == '2'):
		return 'YES'
	n = len(s)
	i = 0
	j = 0
	string = '2020'
	for x in range(0, 4):
		if s[x] == string[x]:
			i += 1
		else:
			break
	for x in range(n - 1, n - 5, -1):
		if s[x] == string[x - (n - 4)]:
			j += 1
		else:
			break
	if i + j >= 4:
		return 'YES'
	return 'NO'
t = int(input())
for _ in range(t):
	n = int(input())
	s = input()
	print(func(s))


import re

def solve():
	input()
	s = input()
	l = []
	l.append('^2(.*?)020$')
	l.append('^20(.*?)20$')
	l.append('^202(.*?)0$')
	l.append('^(.*?)2020$')
	l.append('^2020(.*?)$')
	for i in l:
		if re.match(i, s):
			print('YES')
			return
	print('NO')
t = int(input())
for _ in range(t):
	solve()


import re
exp = '^(\\d*2020|2\\d*020|20\\d*20|202\\d*0|2020\\d*)$'
T = int(input())
for i in range(T):
	n = int(input())
	N = input()
	if re.match(exp, N):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	first_four = s[0:4]
	last_four = s[-1] + s[-2] + s[-3] + s[-4]
	last_four = last_four[::-1]
	if first_four == '2020' or last_four == '2020':
		print('YES')
	elif first_four[0] + last_four[1:] == '2020':
		print('YES')
	elif first_four[0:2] + last_four[2:] == '2020':
		print('YES')
	elif first_four[0:3] + last_four[3:] == '2020':
		print('YES')
	else:
		print('NO')