#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define mod 1000000007
#define loop(x,a,n) for(ll x = a; x < n; ++x)
#define In(a,n) vector<ll> a(n);for(ll x = 0; x < n; ++x){cin >> a[x];}
#define Inm(a,n,m) vector<vector<ll>> a(n, vector<ll> (m,0));for(ll x = 0; x < n; ++x){for(ll y = 0; y < m; y++){cin >> a[x][y];}}
#define TT long long int t;cin >> t; while(t--)
#define lop(x,n,a) for(ll x = n-1; x >= a; --x)
#define asd cout << "asd" << endl;
#define VI(a,n) vector<ll> a(n);
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define MAX 998244353 
#define MIN -10000000007
void swap(vector<ll> &v, ll i, ll j){if(i < 0 || j >= v.size()){return;}auto temp = v[i];v[i]=v[j];v[j]=temp;return;}
void swap(ll &a, ll &b){ll temp=a;a=b;b=temp;}
void dv(vector<ll> g1) { for (auto i = g1.begin(); i != g1.end(); ++i) { cout << *i << " "; } }
ll invert(ll a) {if (a == 0) {return 1;}else if(a==1){return 0;} else{return -1;}}
ll fact(ll n) { ll res = 1;for (ll i = 2; i <= n; i++) res = (res%MAX * i%MAX)%MAX;return res%MAX;} 
ll nCr(ll n, ll r){return (fact(n) / (fact(r) * fact(n - r)))%MAX;} 
ll nCr1(ll a,ll b){if(b > a){return 0;}else{ll ans=1;loop(i,b+1,a+1){ans=ans*i%MAX;} return ans;}}
ll func(ll a){if(a%2 == 0){return -1;}else{return 1;}} 
ll sumofdigits(ll n){ll sum=0;while(n){sum += n%10;n = n/10;}return sum;}
ll poweroftwo(ll n){if(n<=0){return -1;}ll ans = 0;while(n!=1){n=n/2;ans++;}return ans;}
ll noofdigits(ll n){if(n<=0){return 0;}ll ans = 0;while(n){ans++;n=n/10;}return ans;}
ll nooofonesinbits(ll n){ll count = 0;while (n){count += n & 1;n >>= 1;}return count;}
ll __ceil(ll a,ll b){return (a + b - 1)/b;}
ll __pow(ll a, ll b) {if (b == 0){return 1;}ll res = __pow(a, b / 2);if (b % 2){return res * res * a;}else{return res * res;}}

ll modInverse(ll a, ll m) { // a*modinv(b, m) = (a/b)%m
    ll m0 = m;
    ll y = 0, x = 1;

    if (m == 1)
        return 0;

    while (a > 1) {
        ll q = a / m;
        ll t = m;
        m = a % m, a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0)
        x += m0;

    return x;
}


int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
////////////////////////////////////////////
//////NEVER EVER USE CEIL//////////////////
//////////////////////////////////////////
    
   
    TT{
       ll n;
       cin >> n;
       string s;
       cin >> s;
       vector<ll> c(n,0);

       ll a=0,b=0;
       loop(i,0,n){
        //cout << s[i] << endl;
        if(s[i] == '0'){b++;}
        else{
            if(i == 0){continue;}
            if(s[i-1] == '1' && c[i-1] == 0){a++;c[i-1]=1;c[i]=1;}
        }
       }
       ll x = fact(a+b)%MAX, y = (fact(a)%MAX*fact(b)%MAX)%MAX;
       cout << (x%MAX*modInverse(y,MAX)%MAX)%MAX << endl;
    }   
    

}