// In the name of god
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define debug(x) cerr << #x << " : " << x << "\n";
#define use_file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef string str;

const ll maxn = 2e5 + 5;
const ll mod = 998244353;
const ll inf = 1e18;

ll t, n, a[maxn], cnt[2][maxn];
ll fac[maxn], inv[maxn];
ll pw(ll A, ll B){
	ll RES = 1;
	while(B){
		if(B % 2)RES = (RES * A % mod);
		A = (A * A) % mod;
		B >>= 1;
	}
	return RES;
}
int main(){
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	fac[0] = 1;
	for(ll i = 1; i < maxn; i ++)fac[i] = (fac[i - 1] * i) % mod;
	inv[maxn - 1] = pw(fac[maxn - 1], mod - 2);
	for(ll i = maxn - 2; i >= 0; i --)
		inv[i] = (inv[i + 1] * (i + 1ll)) % mod;
	cin >> t;
	while(t --){
		str s;
		cin >> n >> s;
		ll cnt0 = 0, c = 0, cnt1 = 0;
		for(ll i = 0; i < n; i ++){
			if(s[i] == '0'){
				cnt0 ++;
				cnt1 += c / 2;
				c = 0;
			}
			else c ++;
		}
		cnt1 += c / 2;
		cout << fac[cnt1 + cnt0] * inv[cnt1] % mod * inv[cnt0] % mod << "\n";


	}
}
