//Komershan
//@defineintlonglong (telegramm channel)
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <set>
using namespace std;

//for coding
typedef long long ll;
typedef long double ld;
#define all(x) x.begin(), x.end()
#define rd(x) for (auto &i : x) cin >> i;
#define rep(i, l, r) for (int i = (l); i < (r); i++)

//for debug
#define ct(x) for (auto i : x) cout << i << ' ';

template <typename T>
std::ostream& operator <<(std::ostream& output, const std::vector<T>& data)
{
    for (const T& x : data)
        output << x << " ";
    return output;
}

template <typename T>
std::istream& operator >>(std::istream& input, std::vector<T>& data)
{
    for (T& x : data)
        input >> x;
    return input;
}

inline void operator delete (void*) { }

#define int long long

const int mod = 998244353;
vector <int> fact;

void build(int n) {
    fact.resize(1, 1);
    for (int i = 1; i <= n; i++) {
        fact.push_back((fact.back() * i) % mod);
    }
}

int binpow(int a, int p) {
    if (p == 0)
        return 1;
    if (p % 2)
        return (a * binpow(a, p - 1)) % mod;
    else {
        int q = binpow(a, p / 2);
        return (q * q) % mod;
    }
}

int C(int n, int k) {
    return ((fact[n] * binpow(fact[k], mod - 2)) % mod * binpow(fact[n - k], mod - 2)) % mod;
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        build(n);
        string s;
        cin >> s;
        vector <int> ones;
        int counter = 0, one = 0, ost = 0;
        for (int i = 0; i < n; i++) {
            one += s[i] - '0';
            if (s[i] == '1') 
                counter++;
            else {
                ost += counter % 2;
                one -= counter % 2;
                counter = 0;
            }
        }
        if (s.back() == '1') {
            ost += counter % 2;
            one -= counter % 2;
        }
        cout << C(n - one / 2 - ost, one / 2) << '\n';
    }
}