#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, P = 998244353;
int T, n, jc[N], jcv[N]; 
char s[N];

int main() {
	int up = 1e5; jc[0] = 1; for(int i = 1; i <= up; i++) jc[i] = 1ll * jc[i - 1] * i % P; 
	jcv[up] = 812950533; for(int i = up - 1; i >= 0; i--) jcv[i] = 1ll * jcv[i + 1] * (i + 1) % P;
	scanf("%d", &T);
	while(T--) {
		scanf("%d%s", &n, s + 1); int c0 = 0, c1 = 0;
		for(int i = 1; i <= n; i++) {
			if(s[i] == '0') c0++;
			else if(s[i + 1] == '1') c1++, i++;
		}
		printf("%d\n", 1ll * jc[c0 + c1] * jcv[c0] % P * jcv[c1] % P);
	}
	return 0;
}