#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define SZ(x) (int)(x.size())
#define all(x) x.begin(),x.end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pii;
const int maxn = 2e6 + 6;
const int  inf = 0x3f3f3f3f;
const int mod = 998244353;
const int N = 2e3 + 3;
ll qpow(ll x,ll y) { ll ans=1;x%=mod;  while(y) { if(y&1) ans=ans*x%mod; x=x*x%mod;  y>>=1; } return ans; }


int _;
int n;
char s[maxn];
ll fac[maxn],fav[maxn];
ll C(int x,int y) {
    return fac[x]*fav[y]%mod*fav[x-y]%mod;
}
void so() {
    scanf("%d",&n);
    scanf("%s",s+1);
    int zero=0,two=0;
    for(int i=1;i<=n;i++) {
        if(s[i]=='0') {
            zero++;
            continue;
        }
        int j=i;
        while(j+1<=n&&s[j+1]=='1') j++;
        two+=(j-i+1)/2;
        i=j;
    }
    printf("%lld\n",C(zero+two,two));
}
void init() {
    fac[0]=1;
    for(int i=1;i<maxn;i++) fac[i]=fac[i-1]*i%mod;
    fav[maxn-1]=qpow(fac[maxn-1],mod-2);
    for(int i=maxn-2;i>=0;i--) fav[i]=fav[i+1]*(i+1)%mod;
}
int main() {
    init();
    for(scanf("%d",&_);_;_--) {
        so();
    }
    return 0;
}
