#include <bits/stdc++.h>

using namespace std;

#define LL long long

LL f [100010];

void factorial() {
	LL MOD = 998244353;

	f[0] = 1;

	for(int i=1; i<100010; i++) {
		f[i] = (i*f[i-1])%MOD;
	}

	return;
}

LL exp (LL a, LL b) {
	LL MOD = 998244353;

	if(b==1) {
		return a;
	} else {
		LL c = exp(a,b/2);
		c = (c*c)%MOD;

		if((b%2)==1) {
			c=(c*a)%MOD;
		}

		return c;
	}
}

LL binom(LL v, LL w) {
	LL ans = f[v];
	LL MOD = 998244353;

	ans *= exp(f[w],MOD-2);
	ans %= MOD;

	ans *= exp(f[v-w],MOD-2);
	ans %= MOD;

	return ans;
}

void testcase() {
	LL n;

	cin >> n;

	string s;

	cin >> s;

	LL q = 0;

	for(LL i=0; i<n; i++) {
		if(s.at(i) == '0') {
			q++;
		}
	}

	LL a = -1;
	LL b = -1;
	LL x = 0;

	for(LL i=0; i<n; i++) {
		if(s.at(i) == '0') {
			a=b;
			b=i;

			if(((a+b+2)%2)==1) {
				x++;
			}
		}
	}

	a=b;
	b=n;

	if(((a+b)%2)==1) {
		x++;
	}

	LL l = (n+x-1)/2;

	cout << binom(l,q) << '\n';
	return;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	factorial();

	int t;

	cin >> t;

	for(int i=0; i<t; i++) {
		testcase();
	}

	return 0;
}