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

typedef long long ll;
typedef long double ld;

const ll mod = 998244353;
ll powermod(ll a, int exp) {
    ll ans = 1;
    for (; exp > 0; exp /= 2, a *= a, a %= mod) {
        if (exp % 2 == 1) ans *= a;
        ans %= mod;
    }
    return ans;
}
ll inv(int a) {
    ll ans = powermod(a, mod - 2);
    return ans;
}

ll combo(int num, int denom) {
    if (denom > num/2) denom = num - denom;
    ll ans = 1;
    for (ll i = num, j = 1; j <= denom; i--, j++) {
        ans *= i; ans %= mod; ans *= inv(j); ans %= mod;
    }
    return ans;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    
    int t; cin >> t;
    while (t--) {
        int n; cin >> n;
        string s; cin >> s;

        int zeros = 0; int ones = 0; int pones = 0;
        for (int i = 0; i < s.size(); i++) {
            if (s[i] == '1') {
                ones++; 
                if (ones % 2 == 0) pones++;
            }
            else {
                zeros++; ones = 0;
            }
        }
        
        cout << combo(zeros + pones, zeros) << '\n';
    }
}