#include <bits/stdc++.h>
using namespace std;
#define ll long long

ll MOD = 998244353;
ll MAX = 100010;

ll inv(ll a) { return a == 1 ? 1 : ((inv(MOD % a) * (MOD - MOD / a)) % MOD); };

int main() {
    vector<ll> f(MAX, 1);
    vector<ll> rf(MAX, 1);
    for (int i = 1; i < MAX; i++) {
        f[i] = f[i - 1] * i % MOD;
        rf[i] = rf[i - 1] * inv(i) % MOD;
    }

    ll T, n;
    cin >> T;
    string s;
    while (T--) {
        cin >> n;
        cin >> s;
        ll cg = 0, c = 0;
        for (int i = 0; i < n; i++) {
            if (s[i] == '0') {
                c++;
            } else if (s[i] == '1' && i < n - 1 && s[i + 1] == '1') {
                cg++;
                i++;
            }
        }
        cout << f[c + cg] * rf[c] % MOD * rf[cg] % MOD << endl;
    }
}