#pragma GCC optimize ("Ofast,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")

#include <bits/stdc++.h>

using namespace std;

constexpr int N = 2e5+7;
constexpr int M = 998244353;

#define fastio ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define int long long
#define pii pair<int, int>
#define fi first
#define se second
#define SZ(x) ((int)(x.size()))

#ifdef int
#define INF 0x3f3f3f3f3f3f3f3f
#define INF2 (int)(0xcfcfcfcfcfcfcfcf)
#else
#define INF 0x3f3f3f3f
#define INF2 0xcfcfcfcf
#endif

int fact[N], inv[N];
int qpow(int a, int b){
    int c = 1;
    while(b){
        if(b & 1) c = c * a % M;
        a = a * a % M;
        b >>= 1;
    }
    return c;
}
int C(int n,int m){
    if(n < 0 || m > n) return 0;
    return fact[n] * inv[m] % M * inv[n-m] % M;
}
void init(){
    fact[0] = 1;
    for (int i = 1; i < N; i++) fact[i] = fact[i-1] * i % M;
    inv[N-1] = qpow(fact[N-1], M - 2);
    for(int i= N-2; i >= 0; i--) inv[i] = inv[i+1] * (i+1) % M;
}
void add(int& x, int y) {
    x %= M, y %= M;
    x = (x + M + y) % M;
}
int Lucas(int n, int m) {
    if(n < 0 || m > n) return 0;
    if (m == 0) return 1;
    return (C(n % M, m % M) * Lucas(n / M, m / M)) % M;
}

// 想清楚计数的依据

signed main() {
    fastio
    init();
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        int zero = 0, ps = 0;
        vector<int> a(n+1, 0);
        vector<int> p(n+1, 0);
        for (int i = 1; i <= n; i++) {
            char c;
            cin >> c;
            a[i] = c-'0';
            if (a[i] and a[i-1] and !p[i-1]) {
                p[i] = 1;
                ps++;
            }
            if (!a[i]) zero++;
        }
        cout << C(zero+ps, ps) << "\n";
    }
    return 0;
}