#include<bits/stdc++.h>
using namespace std;
#define MOD 998244353
#define LL long long
#define PII pair<int, int>
#define PIL pair<int, LL>
#define PLI pair<LL, int>
#define PLL pair<LL, LL>
#define mp make_pair
#define pb push_back
#define x first
#define y second

int n;
string s;
LL fac[200055];
LL ifac[200055];


LL fpow(LL bse, LL dex) {
	if (dex == 0) return 1;
	else {
		LL tmp = fpow(bse, dex / 2);
		tmp = tmp * tmp % MOD;
		if (dex % 2 == 1) tmp = tmp * bse % MOD;
		return tmp % MOD;
	}
}

void no() {
	cout << "NO" << endl;
}

void yes() {
	cout << "YES" << endl;
}

LL com(LL n, LL k) {
	//cout << n << " " << k << endl;
	//cout << fac[n + 1] <<  " " << ifac[k + 1] << " " << ifac[n - k] << endl;
	return fac[n + 1] * ifac[k + 1] % MOD * ifac[n - k] % MOD;
}

void solve() { 
	cin >> n;
	cin >> s;
	
	LL dig = 0;
	for (int i = 0; i < n; i++) {
		if (s[i] == '1') ++dig;
	}
	
	LL cnt = 0;
	int pnt = 0;
	while (pnt < n - 1) {
		if (s[pnt] == '1' && s[pnt + 1] == '1') {
			pnt += 2;
			cnt += 1;
		}
		else {
			pnt += 1;
		}
	}
	
	LL lly = dig - cnt * 2;
	
	LL sp = n - 2 * cnt + 1 - lly;
	
	//cout << cnt << " " << lly << " " << sp << endl;
	if (cnt == 0) {
		cout << 1 << endl;
		return;
	}
	
	if (sp == 0) {
		cout << 1 << endl;
		return;
	}
	
	LL ans = com(sp + cnt - 2, cnt - 1);
	cout << ans << endl;
}

int main() {
	fac[0] = ifac[0] = 1;
	for (int i = 1; i <= 200005; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		ifac[i] = fpow(fac[i], MOD - 2);
	}
	int t;
	cin >> t;
	while (t--) solve();
	return 0;	
}