#include<bits/stdc++.h>
using namespace std;

const int MOD = 998244353;
int n;
string s;

int modExp(int a, int b) {
	int r = 1;
	while (b) {
		if (b & 1) r = 1LL * r * a % MOD;
		b /= 2;
		a = 1LL * a * a % MOD;
	}
	return r;
}

int main() {
	ios_base::sync_with_stdio(0);
	int T; cin >> T;
	while (T --) {
		cin >> n;
		cin >> s;
		int cur = 0, a = 0, b = 0;
		for (int i = 0; i < n; i ++) {
			if (s[i] == '1') cur ++;
			else {
				a ++;
				a += cur / 2;
				b += cur / 2;
				cur = 0;
			}
		}
		a += cur / 2, b += cur / 2;
		int rlt = 1;
		for (int i = a; i > a - b; i --) rlt = 1LL * rlt * i % MOD;
		for (int j = 2; j <= b; j ++) rlt = 1LL * rlt * modExp(j, MOD - 2) % MOD;
		cout << rlt << endl;
	}
	return 0;
}
