#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
#include<vector>
using namespace std;
typedef long long ll;
#define N 210002
const int p=998244353,iv2=5e8+4;
inline void rd(int &x)
{x=0;register char c=getchar();
    while(c<'0'||c>'9')c=getchar();
    while(c>='0'&&c<='9'){x=x*10+c-48;c=getchar();}
}
inline void upd(int &x,int y){x+=x+y>=p?y-p:y;}
inline int ksm(int d,int k)
{int ret=1;while(k){if(k&1)ret=1ll*ret*d%p;d=1ll*d*d%p;k>>=1;}return ret;}
int T,n,fac[N],finv[N],inv[N];
char ch[N];
inline int C(int nn,int mm)
{
    return 1ll*fac[nn]*finv[mm]%p*finv[nn-mm]%p;
}
int main()
{
    fac[0]=finv[0]=fac[1]=finv[1]=inv[1]=1;
    for(int i=2;i<=200000;i++)
    {
        inv[i]=1ll*(p-p/i)*inv[p%i]%p;
        fac[i]=1ll*fac[i-1]*i%p;finv[i]=1ll*finv[i-1]*inv[i]%p;
    }
    scanf("%d",&T);
    while(T--)
    {
        scanf("%d",&n);
        scanf("%s",ch+1);
        int la=0,al=0,c0=0,c1=0;
        for(int i=1;i<=n;i++)
        {
            if(ch[i]=='0')c0++;
            else c1++;
        }
        for(int i=1;i<=n;i++)
        {
            if(ch[i]=='0')
            {
                if((i-la-1)&1)
                {
                    al++;
                }
                la=i;
            }
        }
        if((n-la)&1)al++;
        int rem=(c1-al)>>1;
        int ans=C(rem+c0,c0);
        printf("%d\n",ans);
    }
}
