#include <bits/stdc++.h>
//---------------------------------------------------
#define l_int                       long long int
#define double                      long double
#define inf                         INT64_MAX
#define mod                         100000
#define fo(i,a,b)                   for(l_int i=a;i<b;i++)
//---------------------------------------------------
using namespace std;

int factorial(int n)
{
    int ans=1;
    while(n!=1)
    {
        ans*=n;
        n--;
    }
    return ans;
}

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    int t,n,k;
    cin >> t;
    while(t--)
    {
        int n;
        cin >> n;
        int c=0;
        char s[n];
        for(int i=0 ; i< n ;i++)
        {
            cin >> s[i];
        }
        if(s[0]=='2' && s[1]=='0' && s[2]=='2' && s[3]=='0')
        {
            c=1;
        }
        if(s[n-1]=='0' && s[n-2]=='2' && s[n-3]=='0' && s[n-4]=='2')
        {
            c=1;
        }
        if(s[0]=='2' && s[n-3]=='0' && s[n-2]=='2' && s[n-1]=='0')
        {
            c=1;
        }
        if(s[0]=='2' && s[1]=='0' && s[n-2]=='2' && s[n-1]=='0')
        {
            c=1;
        }
        if(s[0]=='2' && s[1]=='0' && s[2]=='2' && s[n-1]=='0')
        {
            c=1;
        }
        if(c==1)
        {
            cout << "YES" << endl;
        }else if(c==0)
        {
            cout << "NO" << endl;
        }
    }
}


