#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define PB push_back
#define ALL(a) begin(a),end(a)
#define mem(a,n) memset(a,n,sizeof(a))
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define bug(in) cout<<#in<<" = "<<(in)<<endl;
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define PrQ priority_queue <int, vector<int>, greater<int> >
#define mapit map<int,int>::iterator
using namespace std;
const ll LINF=1e18+5,INF=0x3f3f3f3f,eps=1319,mod=1e9+7;
template<typename T>inline void read(T &a){char c=getchar();T x=0,f=1;while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}while(isdigit(c)){x=(x<<1)+(x<<3)+c-'0';c=getchar();}a=f*x;}
inline ll Qpow(ll a,ll b){ll s=1;while(b){if(b&1){s=(s*a)%mod;}a=a*a%mod;b>>=1;}return s;}
inline ll Qinv(ll a){return Qpow(a,mod-2);}
const int maxn= 2e5+5;

//int dir[][2]={{1,0},{0,1},{-1,0},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1},{0,0}};
//ll n,m,k,q,a[maxn],b[maxn];

int n,a[maxn];
char b[maxn];
//-----
const int MOD=998244353;
ll inv[1000100],jc[1000100],x,y;
void gcd(int a,int b)//拓展欧几里得
{
    if(b==0) {x=1,y=0;return;}
    gcd(b,a%b);
    int k=x;x=y;y=k-a/b*y;
    return ;
}
void pre(){
    jc[1]=1;
    for(int i=2;i<=1000000;i++)	jc[i]=(jc[i-1]*i)%MOD;
    gcd(jc[1000000],MOD);	inv[1000000]=(x+MOD)%MOD;
    for(int i=999999;i>=0;i--)	inv[i]=(inv[i+1]*(i+1))%MOD;
    return ;
}
int C(int n,int m){
    return (((1LL*jc[n]*inv[m])%MOD)*inv[n-m])%MOD;//组合数
}
//-----
void solve()
{
	cin>>n>>b+1;
	rep(i,1,n) a[i] = (b[i]=='0' ? 0:1);
	
	ll x=0,y=0,s=0;
	rep(i,1,n)
	{
		if(a[i]==0)	x++,y+=s/2,s=0;
		if(a[i]==1)	s++;
	}
	y+=s/2;
	cout<<max(1,C(x+y,y))<<endl;
}
int main()
{
	pre();
	IOS;
	int t;cin>>t;while(t--)
	solve();return 0;
}