
// Problem: D. AquaMoon and Chess
// Contest: Codeforces - Codeforces Round #732 (Div. 2)
// URL: https://codeforces.com/contest/1546/problem/D
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
#define mod 998244353
using namespace std;
inline int read(){
   int s=0,w=1;
   char ch=getchar();
   while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
   while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
   return s*w;
}
#define N 100099
#define ll long long
ll f[N]={1};
ll qp(ll a,ll b){
	if(b==1)return a%mod;
	if(b==0)return 1;
	ll x=qp(a,b>>1);
	return b&1?x*x%mod*a%mod:x*x%mod;
}
ll inv(ll x){
	return qp(x,mod-2);
}
ll c(ll n,ll m){
	return f[n]*inv(f[n-m])%mod*inv(f[m])%mod;
}
int a[N];
int main(){
	int Ran_Hou_Tian_Ti_Shi_Zhan_Xiang_Gou_Lian=read();
	for(int i=1;i<=100000;++i)f[i]=(f[i-1]*i)%mod;
	while(Ran_Hou_Tian_Ti_Shi_Zhan_Xiang_Gou_Lian--){
		int n=read(),x=0,y=0;
		for(int i=1;i<=n;++i){
			char ch=getchar();
			while(ch!='0'&&ch!='1')ch=getchar();
			a[i]=ch-'0';
		}
		for(int i=1;i<=n;++i){
			if(a[i]&&a[i+1])++x,++i;
			if(a[i]==0)++y;
		}
		printf("%lld\n",c(x+y,x));
	}
	return 0;
} 
