#include<bits/stdc++.h>
#define mod 998244353
using namespace std;
vector<long long>fac;
void computefac(int n){
	fac[0]=1;
	fac[1]=1;
	for(int i=2;i<=n;i++){
		fac[i]=(fac[i-1]%mod*i%mod)%mod;
	}
}
long long binpow(long long a,long long b){
	long long res=1;
	while(b){
		if(b&1)
		res=(res%mod*(a%mod))%mod;
		a=(a%mod*a%mod)%mod;
		b/=2;
	//	cout<<b<<" "<<a<<" "<<res<<endl;
	}
	return res;
}
long long ncr(int a,int b){
	long long v2=binpow(fac[a-b],mod-2);
	long long v1=binpow(fac[b],mod-2);
//	cout<<fac[a]<<" "<<v1<<" "<<v2<<endl;
	long long val=(((fac[a]%mod)*(v2%mod)%mod)*(v1%mod)%mod);
	return val;
}
int main(){
	int t;cin>>t;while(t--){
	int n;cin>>n;string s;cin>>s;
	fac=vector<long long>(n+2,0);
	computefac(n+1);
	int on=0;
	int cnt=0;
	for(int i=0;i<n;i++){
		if(s[i]=='0')
		cnt++;
		else{
			int cn=0;
			while(s[i]=='1')
			{
				cn++;i++;
			}
			i--;
			on+=(cn/2);
			cnt+=(cn/2);
		}
	}
//	cout<<cnt<<" "<<on<<endl;

	long long ans=ncr(cnt,on);
		cout<<ans<<endl;;
	
	}
}