#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define int long long
#define float double
#define endl ("\n")
#define pb push_back
#define vd vector<int>
#define vecs(v) sort(v.begin(),v.end())
#define rvecs(v) sort(v.rbegin(),v.rend())
#define arrs(a,n) sort(a,a+n)
#define max3(a, b, c) max(c, max(a, b))
#define max4(a, b, c, d) max(d, max(c, max(a, b)))
#define min3(a, b, c) min(c, min(a, b))
#define min4(a, b, c, d) min(d, min(c, min(a, b)))
#define f0(i,n) for(int i=0;i<n;i++)
#define f1(i,n) for(int i=1;i<=n;i++)
#define dv1(a) cout<<#a<<" : "<<a<<" ";cout<<endl;
#define dv2(a,b) cout<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" ";cout<<endl;
#define dv3(a,b,c) cout<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" ";cout<<endl;
#define ph cout<<"ph"<<endl;
#define dvec(a) cout<<"\n"<<#a<<" [ "; for(int w=0;w<a.size();w++) cout<<a[w]<<" "; cout<<"]"; cout<<endl;
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

const ll MOD = 998244353;
const ll INF = 1e9;
const ll LINF = LLONG_MAX;

unsigned long long power(unsigned long long x,
                                  int y, int p)
{
    unsigned long long res = 1; // Initialize result
 
    x = x % p; // Update x if it is more than or
    // equal to p
 
    while (y > 0)
    {
     
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res * x) % p;
 
        // y must be even now
        y = y >> 1; // y = y/2
        x = (x * x) % p;
    }
    return res;
}
 
// Returns n^(-1) mod p
unsigned long long modInverse(unsigned long long n, 
                                            int p)
{
    return power(n, p - 2, p);
}
 
// Returns nCr % p using Fermat's little
// theorem.
unsigned long long nCrModPFermat(unsigned long long n,
                                 int r, int p)
{
    // If n<r, then nCr should return 0
    if (n < r)
        return 0;
    // Base case
    if (r == 0)
        return 1;
 
    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    unsigned long long fac[n + 1];
    fac[0] = 1;
    for (int i = 1; i <= n; i++)
        fac[i] = (fac[i - 1] * i) % p;
 
    return (fac[n] * modInverse(fac[r], p) % p
            * modInverse(fac[n - r], p) % p)
           % p;
}
void solve() {
    int n;
    cin>>n;
    string s;   cin>>s;
    int cnt=0,z=0;
    f1(i,s.length()-1){
       if(s[i-1]=='1' && s[i]=='1'){
           i++;
           cnt++;
       }
    }
    f0(i,s.length())    if(s[i]=='0')   z++;
//    dv2(cnt,z);
    // int num = mul(cnt+1,cnt+z);
    // int den = mul (1,z);
    // int res = (num/den);
    // dv2(num,den);
    int res = nCrModPFermat(cnt+z,z,MOD);
    cout<<res<<endl;
}


int32_t main(){
    fastio   
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int t=1,count=1;
    
    cin>>t;
    while(t--){
        // cout << "Case #" << count  << " : "<<endl;
        // count++;
        solve();        
    }
    return 0;
}


