#include <bits/stdc++.h>
//
const int INF = 0x3f3f3f3f;//1.06e9大小
const int mod = 998244353;
const double PI = acos ( -1 );
const double eps = 1e-6;
typedef unsigned long long ull;
typedef long long ll;
#define pii pair<int ,int>
#define ms(a,k) memset(a,k,sizeof(a))
#define X first
#define Y second
#define lowbit a&(-a)
using namespace std;
const int maxn = 1e5+10;
ll fac[maxn*2];
ll ksm(ll a,ll b)
{
	ll res =1;
	while(b)
	{
		if(b&1)res = res*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return res;
}
ll C(int k,int n)
{
	return fac[n]*ksm(fac[k]*fac[n-k]%mod,mod-2)%mod;
}
int main()
{
	fac[0] = fac[1] =1;
	for(int i=2;i<maxn*2;++i)fac[i] = fac[i-1]*i%mod;
	int t;scanf("%d",&t);
	while(t--)
	{
		int n;scanf("%d",&n);
		string s;cin>>s;
		int cnt0=0,cnt11=0,rem=0;
		for(int i =0;i<s.size();++i)
		{
			if(s[i]=='1')rem++;
			else {cnt11+=rem/2;rem=0;++cnt0;}
		}
		cnt11+=rem/2;
		//printf("%d %d\n",cnt0,cnt11);
		printf("%lld\n",C(cnt0,cnt11+cnt0));
	}
	return 0;
}
