//μ's forever
#include <bits/stdc++.h>
#define mod 998244353
//#define getchar nc
using namespace std;
inline char nc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
inline int read()
{
    register int x=0,f=1;register char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
    return x*f;
}
inline void write(register int x)
{
    if(!x)putchar('0');if(x<0)x=-x,putchar('-');
    static int sta[20];register int tot=0;
    while(x)sta[tot++]=x%10,x/=10;
    while(tot)putchar(sta[--tot]+48);
}
int T,n,a[100005],cnt,tot,kk,fac[100005],invf[100005];
int power(int a,int b){
    int res=1;
    while(b){
        if(b&1) res=1ll*res*a%mod;
        a=1ll*a*a%mod,b>>=1;
    }
    return res;
}
int binom(int n,int m){
    return 1ll*fac[n]*invf[m]%mod*invf[n-m]%mod;
}
int main()
{
    T=read();
    fac[0]=1;
    for(int i=1;i<=100000;++i) fac[i]=1ll*fac[i-1]*i%mod;
    invf[100000]=power(fac[100000],mod-2);
    for(int i=100000;i>=1;--i) invf[i-1]=1ll*invf[i]*i%mod;
    while(T--){
        n=read(),tot=0,kk=0;
        for(int i=1;i<=n;++i){
            char ch=getchar();
            while(ch!='0'&&ch!='1') ch=getchar();
            a[i]=ch-'0';
        }
        for(int i=1;i<=n;++i)
            if(a[i]==1){
                int cnt=0;
                while(a[i]==1&&i<=n) ++cnt,++i;
                tot+=cnt/2;
                kk+=cnt&1;
            }
        // cerr<<tot<<endl;
        printf("%d\n",binom(n-kk-tot,tot));
    }
    return 0;
}
