#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int len,flag=0,tt=1,flag2=0;
		char ch[222];
		cin>>len;			
		cin>>ch;
		int cnt=0;
		int num=2;
		if(tt&ch[0]=='2'&&ch[1]=='0'&&ch[2]=='2'&&ch[3]=='0')
		{
			cout<<"YES"<<endl;
			tt=0;
		}
		if(tt&ch[0]=='2'&&ch[1]=='0'&&ch[2]=='2'&&ch[len-1]=='0')
		{
			cout<<"YES"<<endl;
			tt=0;
		}
		if(tt&ch[0]=='2'&&ch[1]=='0'&&ch[len-2]=='2'&&ch[len-1]=='0')
		{
			cout<<"YES"<<endl;
			tt=0;
		}
		if(tt&ch[0]=='2'&&ch[len-3]=='0'&&ch[len-2]=='2'&&ch[len-1]=='0')
		{
			cout<<"YES"<<endl;
			tt=0;
		}
		if(tt&ch[len-4]=='2'&&ch[len-3]=='0'&&ch[len-2]=='2'&&ch[len-1]=='0')
		{
			cout<<"YES"<<endl;
			tt=0;
		}
		if(tt)
			cout<<"NO"<<endl;
	} 
    return 0;
}