#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const int N = 1e5 + 10;
const int INF = 0x3f3f3f3f;
const ll INFF = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
typedef pair<int, int> PII;
#define debug(x) cout<<#x<<"="<<x<<endl;

int t, n, m, k;
string s;
ll qm(ll x, ll y)
{
	ll res = 1;
	while (y)
	{
		if (y & 1) res = (res * x) % mod;
		y >>= 1;
		x = (x*x) %mod;
	}
	return res;
}
int main()
{
	IOS cin >> t;
	while (t--)
	{
		int sum1=0, sum0=0;
		cin >> n >> s;
		for (int i=0; i<n; i++)
		{
			if (s[i] == '0') sum0 ++;
			else 
			{
				int x = 0;
				while (s[i] == '1')
				{
					x ++;
					i ++;
				}
				i--;
				sum1 += x/2;
			}
		}
		// cout << sum1 << ' ' << sum0 << endl;
		ll ans = 1;
		m = sum0+sum1;
		//debug(sum0);
		//debug(m);
		//cout << m << endl;
		for(int i=sum1+1; i<=m; i++)
			ans = (ans*i)%mod;	
		//cout << ans << endl;
		for(int i=2; i<=sum0; i++)
		{
			ll ni = qm(i,mod-2);
			ans = (ans*ni)%mod;
		}
		cout << ans << endl;
	}
	return 0;
}