#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=998244353;
const ll mx=1e5+1;
ll f[mx];
ll t, n, j, k, nol, satu, cek, ans1, ans2;
string s;

ll pow(ll a, ll b){
	if(b==0){
		return 1;
	}
	else{
		if(b%2!=0){
			return (a*(pow(a,b/2)*pow(a,b/2)%mod))%mod;
		}
		else{
			return pow(a,b/2)*pow(a,b/2)%mod;
		}
	}
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	
	f[0]=1;
	for(ll i=1; i<mx; i++){
		f[i]=i*f[i-1]%mod;
	}
	
	cin >> t;
	while(t--){
		cin >> n >> s;
		nol=0;
		satu=0;
		k=0;
		while(k<n){
			if(s[k]=='0'){
				nol++;
				k++;
			}
			else if(s[k]=='1'){
				j=k;
				while(s[j]=='1' && j<n){
					j++;
					cek++;
				}
				satu+=(cek/2);
				cek=0;
				k=j;
			}
		}
		ans1=f[nol+satu]*pow(f[nol],mod-2)%mod;
		ans2=ans1*pow(f[satu],mod-2)%mod;
		cout << ans2 << "\n";
	}
return 0;
}