#include <iostream>
#include <algorithm>
using namespace std;

const int MOD = 998244353;
long long f[100005],invf[100005];

long long inv(int a, int m){
    if(a==1) return 1;
    else return (m - (m/a) * inv(m%a, m) % m);
}

int main(){
    int t,n,a,b,d;
    long long ans;
    char s[100005];

    f[0] = invf[0] = 1;
    for(int i=1; i<100005; i++){
        f[i] = f[i-1] * i % MOD;
        invf[i] = invf[i-1] * inv(i,MOD) % MOD;
    }

    cin >> t;

    while(t>0){
        cin >> n;
        cin >> s;

        a = b = 0;
        for(int i=0; i<n; i++){
            if(s[i]=='0') a++;
            else if(i+1 < n && s[i+1]=='1'){
                b++;
                i++;
            }
        }

        ans = f[a+b] * invf[a] % MOD * invf[b] % MOD;

        cout << ans << endl;
        t--;
    }
}
