﻿#include<bits/stdc++.h>
#define int long long
using namespace std;

const int N = 2e5+7;
const double eps = 1e-8;
const int inf = 0x7f7f7f7f;
const int mod = 998244353;
int T;
int n,m,k;
string s;
int a[N];
int dp[N];
int ans1,ans2,ans;
int inv(int a){
	return a==1?1:(mod-mod/a)*inv(mod%a)%mod;
}
int C(int n,int m){
	if(m>n-m) m=n-m;
	int up=1,down=1;
	for(int i=0;i<m;i++){
		up=up*(n-i)%mod;
		down=down*(i+1)%mod;
	}
	return up*inv(down)%mod;
}
signed main(){
	cin>>T;
	while(T--){
		cin>>n;
		cin>>s;
		ans1=ans2=0;
		for(int i=0;i<n;i++){
			a[i+1]=s[i]-'0';
		}
		int now=0;
		for(int i=1;i<=n;i++){
			//cout<<a[i];
			if(a[i]==1){
				now++;
				continue;
			}
			ans2++;
			now/=2;
			ans1+=now;
			now=0;
		}
		now/=2;
		ans1+=now;
		//cout<<ans1<<" "<<ans2<<endl;
		cout<<C(ans1+ans2,ans2)%mod<<"\n";
	}
	return 0;
}