#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<string>
#include<queue>
#define ll long long
#define mem(a, b) memset(a, b, sizeof a)
using namespace std;
const int maxn = 1e5+10;
const int mod = 998244353;
char a[maxn];
ll inv[maxn], fac[maxn];  //分别表示逆元和阶乘,记得ll

ll quickPow(ll a,ll b){
    ll ans=1;
    while(b){
        if(b&1)
            ans=(ans*a)%mod;
        b>>=1;
        a=(a*a)%mod;
    }
    return ans;
}

void init(){
    fac[0]=1;
    for(int i=1;i<maxn;i++){
        fac[i]=fac[i-1]*i%mod;
    }
    inv[maxn-1]=quickPow(fac[maxn-1],mod-2);
    for(int i=maxn-2;i>=0;i--){
        inv[i]=inv[i+1]*(i+1)%mod;
    }
}
ll cal(int n,int m){
    if(m==0)
        return 1;
    return fac[n]*inv[m]%mod*inv[n-m]%mod;
}

int main(){
    int T;
    scanf("%d",&T);
    init();
    while(T--){
        int n;
        scanf("%d", &n);
        scanf(" %s", a);
        int len = 0, sum = 0;
        for (int i = 0; i < n-1; i++){
            if(a[i]=='1' && a[i+1]=='1'){
                len++;
                sum++;
                i++;
            }
            if(a[i]=='0')
                len++;
        }
        if(a[n-1]=='0')
            len++;
        printf("%lld\n", cal(len, sum));
    }
    return 0;
}