#include<bits/stdc++.h>
using namespace std;
 
typedef long long LL;
 
const int MAXN = 100005;
const int mod = 998244353;
 
char s[MAXN];
int n;
 
int f[MAXN], invf[MAXN];
 
int power(int x, int n) {
    int res = 1;
    while(n) {
        if(n&1) res = 1LL * res * x % mod;
        x = 1LL * x * x % mod;
        n >>= 1;
    }
    return res;
}
 
void init() {
    f[0] = invf[0] = 1;
    for(int i = 1; i < MAXN; i++) {
        f[i] = 1LL * f[i-1] * i % mod;
        invf[i] = 1LL * invf[i-1] * power(i, mod-2) % mod;
    }
}
 
int c(int n, int m) {
    return 1LL * f[n] * invf[m] % mod * invf[n-m] % mod;
}
 
void solve() {
    scanf("%d%s", &n, s);
    int double_one = 0, zero = 0;
    for(int i = 0; i < n; i++) {
        if(s[i] == '0') zero++;
        else if(i+1 < n && s[i] == '1' && s[i+1] == '1') double_one++, i++;
    }
    printf("%d\n", c(double_one+zero, zero));
}
 
int main() {
    init();
    int T = 1;
    scanf("%d", &T);
    for(int i = 1; i <= T; i++) solve();
    return 0;
}