#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100000, mod = 998244353;
ll fac[N + 1], inv[N + 1];
ll power(ll a, ll b) {
    ll ret = 1;
    for (; b; b >>= 1, a = a * a % mod)
        if (b & 1)
            ret = ret * a % mod;
    return ret;
}
ll C(int n, int k) {
    return fac[n] * inv[k] % mod * inv[n - k] % mod;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    fac[0] = 1;
    for (int i = 1; i <= N; i++) {
        fac[i] = fac[i - 1] * i % mod;
    }
    inv[N] = power(fac[N], mod - 2);
    for (int i = N - 1; i >= 0; i--) {
        inv[i] = inv[i + 1] * (i + 1) % mod;
    }
    int t;
    cin >> t;
    while (t--) {
        int n; cin >> n;
        string s; cin >> s;
        int cnt[2] = {}, lst = 0;
        for (int i = 0; i < n; i++) {
            if (s[i] == '0' || lst) {
                ++cnt[s[i] - '0'];
                lst = 0;
            } else {
                lst = 1;
            }
        }
        cout << C(cnt[0] + cnt[1], cnt[0]) << '\n';
    }
    return 0;
}
