#include<bits/stdc++.h>
using namespace std;

/**
 * this function returns the gcd of a and b and fills the passed refrences with the coeff x, y 
 * such that max(a, b)x + min(a, b)y = gcd(a, b)
 * note that x will give the coeff of max(a, b) and y will give coeff of min(a, b)
*/
int extended_euclid(int a, int b, int& x, int& y) {
	if(a < 0) a = -a;
	if(b < 0) b = -b;
	if(a < b) swap(a, b);
	// now a, b are non negative and a is greater than b
	int sx = 0, sy = 1;
	int ssx = 1, ssy = 0;
	while(b != 0) {
		x = -(a / b) * sx + ssx;
		y = -(a / b) * sy + ssy;
		ssx = sx;
		ssy = sy;
		sx = x;
		sy = y;
		a = a % b;
		swap(a, b); // the above line made a smaller than b, hence swap it
	}
	x = ssx;
	y = ssy;
	return a;
}

int mod_inverse(int a, unsigned mod) {
    int x, y;
    int gcd = extended_euclid(a, mod, x, y);
    // cout << x << " " << y << " " << gcd << endl;
    if(gcd == 1) {
        return ((a < mod ? y : x) + mod) % mod;
    }
    return 0;
}

int nCr(int n, int r, int mod) {
	long long ans = 1LL;
	int ri = 1;
	while(ri <= r) {
		ans *= (n - ri + 1);
		ans %= mod;
		ans *= mod_inverse(ri, mod);
		ans %= mod;
		ri++;
	}
	return ans;
}

int main() {
	int t, n, i;
	char s[100000];
	scanf("%d", &t);
	while(t--) {
		scanf("%d", &n);
		scanf("%s", s);
		int last = -1;
		long long pairCount = 0;
		long long zeroCount = s[0] == '0' ? 1 : 0;
		for(i = 1; i < n; i++) {
			if(s[i] == '1' && s[i - 1] == '1' && last != i - 1) {
				last = i;
				pairCount++;
			}
			if(s[i] == '0') {
				zeroCount++;
			}
		}
		// printf("%d %d : ", zeroCount + pairCount, pairCount);
		printf("%d\n", nCr(zeroCount + pairCount, pairCount, 998244353));
	}
	return 0;
}