#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
ll fact[1000005], inv_fact[1000005];
ll bigmod(ll base, ll pow)
{
    if(pow==0) return 1;
    ll d=bigmod(base,pow/2);
    d*=d;
    d%=mod;
    if(pow%2==0) return d%mod;
    return base*d%mod;
}


void factorial()
{
    fact[0]=1;
    inv_fact[0]=1;
    for(int i=1;i<1000000;i++) {
        fact[i]=i*fact[i-1];
        fact[i]%=mod;
        inv_fact[i] = bigmod(fact[i],mod-2);
    }
}


ll nCr( ll n, ll r )
{
    ll ans= fact[n];
    ans*= inv_fact[n-r];
    ans%=mod;
    ans*=inv_fact[r];
    ans%=mod;
    return ans;
}

void solve()
{
    ll n,i,cnt=0LL,bnt=0LL;
    string s;
    cin >> n >> s;
    int vis[n+5];
    memset(vis, 0 , sizeof vis);
    if(s[0]=='0') bnt++;
    for(i=1;i<n;i++) {
        if(s[i]=='1' && s[i-1]=='1' && vis[i-1]==0) {
            vis[i]=1;
            cnt++;
        }
        else if(s[i]=='0') bnt++;
    }

   // cout << cnt << " " << bnt << endl;
    cout << nCr(cnt+bnt, cnt) << endl;
}

int main()
{
    factorial();
    int t=1;
    cin >>t;
    while(t--) solve();
}
