#include<bits/stdc++.h>
using namespace std;
#define ll long long
int T,n;
char a[1100010];
const ll mod = 998244353;
ll inv[1000010],fact[1000010],finv[1000010];
void init(int n) {
	int i;
	for (inv[1] = 1, i = 2; i <= n; ++i) inv[i] =(ll)(mod - mod / i) * inv[mod % i] % mod;
	for (*finv = *fact = i = 1; i <= n; ++i) fact[i] = (ll)fact[i - 1] * i % mod, finv[i] = (ll)finv[i - 1] * inv[i] % mod;
}
int main(){
    init(1000001);
    cin>>T;
    while(T--){
        cin>>n;
        cin>>(a+1);
        int z=0;
        int l1=0;
        for(int i=1;i<=n;i++) if(a[i]=='0') z++;
        for(int i=1;i<=n;i++){
            {
                int nowp=i;
                int cnt=0;
                while(nowp<=n&&a[nowp]=='1') cnt++,nowp++;
                l1+=cnt/2;
                i=nowp;
            }
        }
        //cout<<z<<" "<<l1<<endl;
        ll ans=1;
        z+=l1;
        ans*=fact[z];
        ans*=finv[l1];
        ans%=mod;
        ans*=finv[z-l1];
        ans%=mod;
        cout<<ans<<endl;
    }
}