#include<iostream>
#include<vector>
#include<algorithm>
#include<string>

using namespace std;

const long long p = 998244353, INF = 1e5 + 2;

long long power(const long long base, long long c)
{
	if (c == 0)
	{
		return 1;
	}
	if (c % 2)
	{
		return base * power(base, c - 1) % p;
	}
	long long gett = power(base, c / 2);
	return gett * gett % p;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	vector<long long> fact(INF);
	fact[0] = 1;
	for (long long i = 1; i < INF; ++i)
	{
		fact[i] = fact[i - 1] * i % p;
	}
	int t;
	cin >> t;
	while (t--)
	{
		int n;
		cin >> n;
		vector<char> a(n);
		for (int i = 0; i < n; ++i)
		{
			cin >> a[i];
		}
		long long cnt0 = 0, cnt11 = 0, cnt1 = 0;
		for (int i = 0; i < n; ++i)
		{
			if (a[i] == '1')
			{
				++cnt1;
			}
			else
			{
				++cnt0;
				cnt11 += cnt1 / 2;
				cnt1 = 0;
			}
		}
		cnt11 += cnt1 / 2;
		cout << fact[cnt0 + cnt11] * power(fact[cnt0], p - 2) % p * power(fact[cnt11], p - 2) % p << '\n';
	}
}