#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=998244353;
char s[100005];
ll prod[100005],inv[100005];
int n;
ll pw(ll a,int b)
{
	ll c=1;
	while(b)
	{
		if(b&1)
			c=c*a%mod;
		b=b/2;
		a=a*a%mod;
	}
	return c;
}
int main()
{
	prod[0]=inv[0]=1;
	for(int i=1;i<=100000;++i)
		prod[i]=prod[i-1]*(ll)i%mod,inv[i]=pw(prod[i],998244351);
	int _;
	scanf("%d",&_);
	while(_--)
	{
		scanf("%d",&n);
		scanf("%s",s+1);
		int cnt11=0,cnt0=0,cnt1=0;
		for(int i=1;i<=n;++i)
			if(s[i]=='0')
				++cnt0,cnt11+=cnt1/2,cnt1=0;
			else
				++cnt1;
		cnt11+=cnt1/2;
		printf("%lld\n",prod[cnt11+cnt0]*inv[cnt0]%mod*inv[cnt11]%mod);
	}
}
