#include<bits/stdc++.h>
using namespace std;
#define ll long long
///#define lll long long 
//#define FAST1 ios_base::sync_with_stdio(false);
//#define FAST2 cin.tie(NULL);
const ll N=1e5+5;
ll fac[N + 1];
const ll p=998244353;
const ll mod = p;

ll pow(ll x, ll y, ll p)
{
    ll r = 1; 
   
    x = x % mod;
    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
         r = (r * x) % mod;
        y = y >> 1; // y = y/2
        x = (x * x) % mod;
    }
    return r;
}

ll ff(ll n,ll mod)
                   
{
    return pow(n, mod- 2, mod);
}



ll fff(ll n,ll r,ll p)
{
    // If n<r, then nCr should return 0
    if (n < r)
        return 0;
    // Base case
    if (r == 0)
        return 1;
    return (fac[n] * ff(fac[r], mod) % mod
            * ff(fac[n - r], mod) % mod)
           % mod;
}
int main(){
  ll t;
    cin>>t;
    fac[0] = 1;
    for (int i = 1; i <= N; i++)
      fac[i] = (fac[i - 1] * i) % p;
    while(t--){
    ll n;
    cin>>n;{}
    string s;
    cin>>s;
    ll cut=0;
    ll vall=0;
    ll vis[n];
    for(ll i=0;i<n;i++){
        vis[i]=0;
        if(s[i]=='0')
            cut+=1;
    }
    for(ll i=1;i<n;i++){
        if(s[i]=='1' && s[i-1]=='1' && vis[i-1]==0){
            vall++;
            vis[i]=1;
        }
    }
    cout<<fff(cut+vall,vall,p)<<endl;
    }}
  