#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define int long long
#define up(i,x,y) for(int i=x,i##end=y;i<=i##end;++i)
#define down(i,x,y) for(int i=x,i##end=y;i>=i##end;--i)
using namespace std;
int n, m, k;
int read()
{
    int s = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9')
    {
        if (ch == '-')
            f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9')
    {
        s = s * 10 + ch - '0';
        ch = getchar();
    }
    return s * f;
}
int a[202020];
const int mod=998244353;
int f[202020];
int qpow(int a,int b=mod-2)
{
	int ans=1;
	while(b)
	{
		if(b&1)ans=ans*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return ans;
}
int c(int n,int m)
{
	return f[n]*qpow(f[m])%mod*qpow(f[n-m])%mod;
}
signed main()
{
	int T=read();
	f[0]=1;
	up(i,1,150000)f[i]=(f[i-1]*i)%mod;
	while(T--)
	{
		n=read();
		up(i,1,n)scanf("%1d",&a[i]);
		int f1=n,f2=0;
		int nw=0;
		up(i,1,n)
		{
			if(a[i]==1)
			{
				++nw;
				if(nw==2)++f2,nw=0;
			}
			else
			{
				f1-=nw;
				nw=0;
			}
		}
		if(nw)f1-=nw,nw=0;
		cout<<c(f1-f2,f2)<<endl;
	}
}

