#pragma GCC optimize("Ofast")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
const long double Pi = 3.141592653;
const ll mod=998244353;
long long INF =1000000000000000000;
ll f[100000+5];
struct mycmp
{
    bool operator()(pair<int,int>a,pair<int,int>b)const
    {
        return (a.first<b.first) || (a.first==b.first && a.second>b.second);
    }
};
ll modPow(ll base, ll exp, ll n) 
{

base = base%n;

if (exp == 0)
    return 1;

else if (exp == 1)
    return base;

else if (exp%2 == 0)
    return modPow(base*base%n, exp/2, n);

else
    return base*modPow(base, exp-1, n)%n; 
}
ll modInverse(ll n,ll p)
{
    return modPow(n,p-2,p);
}
ll check(ll n,ll r,ll p)
{
    if(n<r)
    return 0;
    if(r==0)
    return 1;
    
    return (((f[n]*modInverse(f[r],p))%p)*modInverse(f[n-r],p))%p;
}
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    f[0]=1;
    for(ll i=1;i<=1e5+5;i++)
    f[i]=(f[i-1]*i)%mod;
    int t=1;cin>>t;
    while(t--)
    {
        ll n;cin>>n;
        string s;cin>>s;
        ll cnt=0,val=0;
        ll v[n];
        for(int i=0;i<n;i++)
        {
            v[i]=0;
            if(s[i]=='0')
            cnt+=1;
        }
        for(int i=1;i<n;i++)
        {
            if(s[i]=='1')
            {
                if(s[i-1]=='1')
                {
                    if(!v[i-1])
                    {
                        ++val;
                        v[i]=1;
                    }
                }
            }
        }
        cout<<check(cnt+val,val,mod)<<"\n";
    }
}