import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;

immutable long mod   = 998_244_353;
immutable int limit =     100_005;

long powMod (long a, int p)
{
	long res = 1;
	for ( ; p != 0; p >>= 1)
	{
		if (p & 1)
		{
			res = (res * 1L * a) % mod;
		}
		a = (a * 1L * a) % mod;
	}
	return res;
}

alias invMod = a => powMod (a, mod - 2);

auto fact = new long [limit];

long choose (int n, int k)
{
	auto res = fact[n];
	res = (res * 1L * invMod (fact[n - k])) % mod;
	res = (res * 1L * invMod (fact[k])) % mod;
	return res;
}

void main ()
{
	fact[0] = 1;
	foreach (i; 1..limit)
	{
		fact[i] = (fact[i - 1] * 1L * i) % mod;
	}

	auto tests = readln.strip.to !(int);
	foreach (test; 0..tests)
	{
		auto n = readln.strip.to !(int);
		auto a = readln.strip.map !(q{a == '1'}).array;
		int zeroes = 0;
		int pairs = 0;
		for (int i = 0; i < n; i++)
		{
			if (!a[i])
			{
				zeroes += 1;
			}
			else if (i + 1 < n && a[i + 1])
			{
				pairs += 1;
				i += 1;
			}
		}
		writeln (choose (zeroes + pairs, pairs));
	}
}
