#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> //gp_hash_table

#define all(a) a.begin(), a.end()
#define pb push_back
#define eb emplace_back
#define sz(a) (int) a.size()
#define bitcount(a) (int) __builtin_popcount(a)
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define bitat(n, a) ((n>>a)&1)

using namespace std;
// using namespace __gnu_pbds;


typedef long long int ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
using vi = vector<int>;
using vll = vector<ll>;

template <class T> int sgn(T x) { return (x > 0) - (x < 0); }

template <typename T>
inline void read(vector<T>& v) {
    for (T& i : v) cin >> i;
}

const ll MOD = 998244353;

ll ADD(ll a, ll b) {
    return (a+b)%MOD;
}
ll MULT(ll a, ll b) {
    return (a*b)%MOD;
}

ll modpow(ll b, ll e) {
	ll ans = 1;
	for (; e; b = b * b % MOD, e /= 2)
		if (e & 1) ans = ans * b % MOD;
	return ans;
}

const int MAX = 100010;

vll F(MAX);
vll FINV(MAX);

bool solve(int caseN) {
    int n;
    cin >> n;
    string s;
    cin >> s;

    int a = 0, b = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == '0') {
            b++;
        }
        else {
            if (i < n-1 && s[i+1] == '1') {
                i++;
                a++;
            }
        }
    }
    cout << MULT(F[a+b], MULT(FINV[a], FINV[b])) << "\n";

    return false;
}


int main() {
    F[0] = 1;
    for (int i = 1; i < MAX; i++) {
        F[i] = (F[i-1]*i)%MOD;
    }
    FINV[MAX-1] = modpow(F[MAX-1], MOD-2);
    for (int i = MAX-2; i >= 0; i--) {
        FINV[i] = (FINV[i+1]*(i+1))%MOD;
    }
    // freopen("complexity.in", "r", stdin);
    // freopen("complexity.out", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(20);
    cout << fixed;
    int t; cin >> t; for(int i = 1; i <= t; ++i) solve(i); /*
    for (int i = 1; solve(i); i++); /**/
    cout.flush();
    return 0;
}