#include<iostream>
using namespace std;
#define ll long long 
const int MAXN = 100010;
int MOD=998244353;
long long F[MAXN], rF[MAXN];
long long inv(long long a, long long m) {
	if (a == 1) return 1;
	return inv(m%a, m) * (m - m/a) % m;}
int main()
{
F[0] = rF[0] = 1;
	for (int i = 1; i < MAXN; i++) {
		F[i] = F[i-1] * i % MOD;
		rF[i] = rF[i-1] * inv(i, MOD) % MOD;
	}
	
	char a[100010];
	int k;cin>>k;
	while(k--)
	{
	ll l;cin>>l;
		ll sum0=0,sum1=0;int flag=0;ll tem=0;
		for(ll i=0;i<l;i++)
		{
		cin>>a[i];
			if(a[i]=='0')
			{
				sum0++;flag=0;
				sum1+=tem/2;
				tem=0;
				
			}
			else
			{
				if(i==l-1)
				{
					tem++;	sum1+=tem/2;
				}
				flag=1;
				if(flag==1)
				{
				tem++;
				}
			
			}
	
		}

cout<<F[sum1 + sum0] * rF[sum0] % MOD * rF[sum1] % MOD<<endl;
 
	
}
	
	
	
	return 0;
 } 
