#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
const int N=1e5+10,mod=998244353;
int t,n,a[N];
ll dp[N][10];
ll qkpow(ll a,ll b)
{
    ll sum=1;
    while(b)
    {
        if(b&1)sum=sum*a%mod;
        a=a*a%mod;
        b>>=1;
    }
    return sum;
}
ll f[N];
ll get(int a,int b)
{
    return (ll)f[a]*qkpow((ll)f[b]*f[a-b]%mod,mod-2)%mod;
}
void solve()
{
    scanf("%d",&n);
    if(n<3)
    {
        puts("1");
        return;
    }
    string s;
    cin>>s;
    int m=0;
    for(int i=1;i<s.size();)
    {
        if(s[i]==s[i-1]&&s[i]=='1')m++,i+=2;
        else i++;
    }
    n=2*m;
    for(int i=0;s[i];i++)
        if(s[i]=='0')n++;
    printf("%lld\n",get(n-m,m));
}
int main()
{
    f[0]=1;
    for(int i=1;i<=100000;i++)f[i]=(ll)f[i-1]*i%mod;
    scanf("%d",&t);
    while(t--)solve();
    return 0;
}