#include <bits/stdc++.h>
#define int long long
using namespace std;
#define _Fact_Length 500001
#define mod (998244353)
/**Takes a&b as input and Returns : The power (a,b), (a^b)%mod **/
int Power(int _a,int _b)
{
int _result=1; _a%=mod;
while(_b) { if(_b%2==1) _result*=_a; _a*=_a; _a%=mod; _result%=mod; _b/=2;}
return _result;
}
/** It give the modulo inverse of a, (1/a)%mod **/
int Mod_Inv(int _a)
{
_a%=mod; _a=Power(_a,mod-2); return _a;
}
int Factorial[_Fact_Length];
/** It make the above Factorial array to i! array**/
int Make_Factorial()
{
Factorial[0]=1;
for(int i=1;i<_Fact_Length;i++) { Factorial[i]=i*Factorial[i-1]; Factorial[i]%=mod; } return 0;
}
int Implement_Make_Factorial=Make_Factorial();
//To Implement Make_Factorial
/** Takes n&r as input and Returns : nCr%mod **/
int nCr(int _n,int _r)
{
if(_n<_r) return 0;
int _ans=Factorial[_n]; _ans%=mod;
_ans*=Mod_Inv(Factorial[_r]); _ans%=mod;
_ans*=Mod_Inv(Factorial[_n-_r]); _ans%=mod;
return _ans;
}
/**Takes n&r as input and Returns : nPr%mod n!/(n-r)! **/
int nPr(int _n,int _r)
{
int _ans=Factorial[_n]; _ans%=mod;
_ans*=Mod_Inv(Factorial[_n-_r]); _ans%=mod;
return _ans;
}
void solve(){
	int n;
	cin>>n;
	string s;
	cin>>s;
	int one = 0, zero = 0, count = 0;
	vector<int> o;
	for(int i=0; i<n; i++){
		if(s[i] == '0') {
			zero++;
			if(i!=0 && s[i]!=s[i-1]){
				o.emplace_back(count);
				count = 0;
			}
		}
		else {
			count++;
		}
	}
	o.emplace_back(count);
	//for(auto x: o) cout<<x<<" ";
	for(auto x: o) one+=x/2;
	cout<<nCr(one+zero, zero)<<"\n";
}

int32_t main(){
	ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("inputf.in", "r", stdin);
    freopen("outputf.in", "w", stdout);
	#endif
    
	int t=1; //*
	cin>>t;  //*/
	while(t--) solve();
	return 0;
}