#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 998244353;

ll power(ll a, ll b){
    ll res = 1;
    while (b)
    {
        if(b & 1){
            --b;
            res *= a;
            res %= mod;
        }
        else{
            b >>= 1;
            a *= a;
            a %= mod;
        }
    }
    return res;
}

ll fact[100005];
void f(){
    fact[0] = 1;
    for(int i = 1; i <= 100002; i++){
        fact[i] = fact[i - 1] * i % mod;
    }
}

ll inv(ll a){
    return power(a,mod - 2);
}

ll choose(ll a, ll b){
    if(b > a) return 0;
    return fact[a] * inv(fact[b] * fact[a - b] % mod) % mod;
}

string s;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    f();

    int t; cin >> t;

    while (t--)
    {
        int n; cin >> n;
        cin >> s;
        int odd = 0, even = 0;
        int cnt = 0;
        for(int i = 0; i < n; i++){
            if(s[i] == '0'){
                odd += (cnt & 1);
                even += (cnt >> 1);
                cnt = 0;
            }
            else ++cnt;
        }
        odd += (cnt & 1);
        even += (cnt >> 1);

        cout << choose(n - odd - even, even) << '\n';
    }
    cout.flush();
}