#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#define N 1000010
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll mod=998244353 ;
const double eps=1e-6;
int T,n;
int a[N];
ll fac[N];
ll qpow(ll xx, ll yy){
    ll res=1;
    while(yy){
        if(yy&1){
            res*=xx;
            res%=mod;
        }
        xx*=xx;
        xx%=mod;
        yy>>=1;
    }
    return res;
}
ll getC(ll totn,ll totm){
    return fac[totn]*qpow(fac[totm]*fac[totn-totm]%mod,mod-2)%mod;
}
int main()
{
    fac[0]=1;
    for(ll i=1;i<N;++i){
        fac[i]=fac[i-1]*i;
        fac[i]%=mod;
    }
    scanf("%d",&T);
    while(T--){
        scanf("%d",&n);
        for(int i=1;i<=n;++i){
            scanf("%1d",&a[i]);
        }
        int cnt0=0,cnt1=0;
        int totn=0,totm=0;
        for(int i=1;i<=n;++i){
            if(a[i]==1){
                totn+=cnt0;
                cnt0=0;
                cnt1++;
            }
            else{
                totn+=cnt1/2;
                totm+=cnt1/2;
                cnt1=0;
                cnt0++;
            }
        }
        totn+=cnt0;
        totn+=cnt1/2;
        totm+=cnt1/2;
        printf("%lld\n",getC(totn,totm));
//        cout<<totn<<" "<<totm<<endl;
    }
	return 0;
}
//"ehaehcjjaafjdceac"
