#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10, mod = 998244353;
int f[N], inf[N];
int qmi(int a, int k) {
    int sum = 1;
    while (k) {
        if (k & 1) sum = (LL)a * sum % mod;
        a = (LL)a * a % mod;
        k >>= 1;
    }
    return sum;
}
void init() {
    f[0] = inf[0] = 1;
    for (int i = 1; i < N; i ++) {
        f[i] = (LL)f[i - 1] * i % mod;
        inf[i] = (LL)inf[i - 1] * qmi(i, mod - 2) % mod;
        // cout << f[i] << ' ' << inf[i] << ' ';
    }
}
int C(int a, int b) {
    return (LL)f[a] * inf[b] % mod * inf[a - b] % mod;
}
int main() {
    init();
    // cout << f[4] << ' ' << f[2] << ' ' << inf[2] << endl;
    int t;
    cin >> t;
    while (t --) {
        int n;
        cin >> n;
        string s;
        cin >> s;
        int res = 0;
        for (int i = 0; i < n; i ++)
            if (s[i] == '1') res ++;
        int c2=0, c1=0;
		for (int c,i=0;i<n;i++) {
			if (s[i]=='0') c1++;
			else {
				c=0;
				while (s[i]=='1') c++,i++;
				c2+=c/2;
				i--;
			}
		}
        cout << C(c1 + c2, c1) << endl;
    }
    return 0;
}