#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i <= n; ++i)
#define per(i, a, n) for (int i = n; i >= a; --i)
#ifdef LOCAL
#include "Print.h"
#define de(...) W('[', #__VA_ARGS__,"] =", __VA_ARGS__)
#else
#define de(...)
#endif
using namespace std;
typedef long long ll;
const int maxn = 2e5 + 5;
char s[maxn];
const ll mod = 998244353;
ll fac[maxn], inv[maxn];
ll powmod(ll a, ll b) {
    ll ans = 1;
    while (b) {
        if (b & 1) ans = ans * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return ans;
}
void init() {
    fac[1] = fac[0] = 1;
    for (int i = 2; i < maxn; ++i) fac[i] = fac[i - 1] * i % mod;
    inv[maxn - 1] = powmod(fac[maxn - 1], mod - 2);
    for (int i = maxn - 2; i >= 0; --i) inv[i] = inv[i + 1] * (i + 1) % mod;
}
inline ll cal(ll a, ll b) {
    //return fac[a] * powmod(fac[b] * fac[a - b] % mod, mod - 2) % mod;
    return fac[a] * inv[b] % mod * inv[a - b] % mod;
}
int case_Test() {
    int n;
    scanf("%d%s", &n, s + 1);
    int x = 0, y = 0;
    rep(i, 1, n) {
        if (s[i] == '1' && s[i + 1] == '1') x++, i++;
        else if (s[i] == '0') y++;
    }
    printf("%lld\n", cal(x + y, x));
    return 0;
}
int main() {
#ifdef LOCAL
    freopen("in.in", "r", stdin);
    freopen("out.out", "w", stdout);
    clock_t start = clock();
#endif
    int _ = 1;
    scanf("%d", &_);
    init();
    while (_--) case_Test();
#ifdef LOCAL
    printf("Time used: %.3lfs\n", (double)(clock() - start) / CLOCKS_PER_SEC);
#endif
    return 0;
}