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

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;

const int MOD = 998244353;
vector<ll> fact((int)1e5+1);

ll binpow(ll a, ll pow){
	a %= MOD;
	ll res = 1;
	while(pow){
		if(pow&1) res = res * a % MOD;
		pow /= 2;
		a = a * a % MOD;
	}
	return res%MOD;
}

ll inv(ll n){
	return binpow(n, MOD-2);
}

ll choose(int n, int k){
	return ((fact[n] * inv(fact[n-k]) % MOD * inv(fact[k]))%MOD + MOD)%MOD;
}

void solve(){
	int n; cin >> n;
	string s; cin >> s;
	int m=0, z=0;
	for(int i=0;i<n;i++) if(s[i] == '0') z++;
	for(int i=0;i<n-1;i++){
		if(s[i] == s[i+1] && s[i] == '1'){
			m++; i++;
		}
	}
	cout << choose(m+z, m) << endl;
}

int main(){
	fact[0] = 1;
	for(int i=1;i<=(int)1e5;i++){
		fact[i] = fact[i-1] * i % MOD;
	}
	int tc; cin >> tc;
	while(tc--) solve();
}
