#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <char, int>
#define pld pair <ld, ld>
#define ppld pair <pld, pld>
#define ppll pair <pll, pll>
#define pldl pair <ld, ll>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define fastmap gp_hash_table
#define cd complex <double>
#define vcd vector <cd>
#define PI 3.14159265358979
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll mod = 998244353;
ll fact[100005], ivfc[100005];
bool marked[100005];
ll modpow(ll a, ll b){
	ll res = 1;
	while (b){
		if (b & 1) (res *= a) %= mod;
		(a *= a) %= mod; b >>= 1;
	}
	return res;
}
ll moddiv(ll a, ll b){
	return (a * modpow(b, mod - 2)) % mod;
}
void init_(){
	fact[0] = 1; for (ll i = 1; i < 100005; i++) fact[i] = (fact[i - 1] * i) % mod;
	ivfc[100004] = moddiv(1, fact[100004]); for (ll i = 100003; i >= 0; i--) ivfc[i] = (ivfc[i + 1] * (i + 1)) % mod;
}
ll ckn(ll k, ll n){
	if ((k < 0) || (k > n)) return 0;
	return (fact[n] * ivfc[k] % mod * ivfc[n - k] % mod);
}
void solve(){
	ll n; cin >> n;
	for (ll i = 0; i < n; i++) marked[i] = 0;
	string s; cin >> s;
	ll c0 = 0, cp = 0;
	for (ll i = 0; i < n; i++){
		if (s[i] == '1'){
			if (i == 0) marked[i] = 1;
			else if (marked[i - 1] == 0) marked[i] = 1;
			else cp++;
		}
		else c0++;
	}
	cout << ckn(c0, c0 + cp) << "\n";
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	init_();
	ll t; cin >> t;
	while (t--) solve();
}