#include <iostream>
#define MOD 998244353
#define NMAX 100000
#define ll long long

using namespace std;

int t;

ll fact[2*NMAX+10];

void precalc(){
	fact[0] = 1;
	for(int i=1; i<=2*NMAX; i++)
		fact[i] = fact[i-1] * i % MOD;
}

ll lgput(ll a, ll n){
	if(!n)
		return 1;
	if(n % 2 == 0)
		return lgput(a*a % MOD, n/2);
	return a * lgput(a*a % MOD, n/2) % MOD;
}

ll C(ll n, ll k){
	ll val1 = fact[n], val2 = fact[k] * fact[n-k] % MOD;
	return val1 * lgput(val2, MOD - 2) % MOD;
}

int main(){

	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	precalc();

	cin >> t;
	while(t--){
		int n;
		string s;

		cin >> n >> s;
		ll nr1 = 0, nr2 = 0;
		for(int i=0; i<n; i++){
			if(s[i] == '0')
				nr2++;
			else if(i != n - 1 && s[i+1] == '1'){
				nr1++;
				i++;
			}
		}
		cout << C(nr1 + nr2, nr1) << '\n';
	}
	return 0;
}