#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <bitset>

using namespace std;

const long long MOD = 998244353;

long long pow(long long a, long long p)
{
    if (p == 0)
        return 1;
    if (p == 1)
        return a;

    long long ph = pow(a, p / 2);
    if (p % 2 == 0)
        return ph * ph % MOD;
    else
        return ph * ph % MOD * a % MOD;
}

int main()
{
    long long fact[100001];
    fact[0] = 1;
    fact[1] = 1;
    for (long long i = 2; i <= 100000; i++)
        fact[i] = fact[i - 1] * i % MOD;

    int t;
    scanf("%d", &t);
    while (t--)
    {
        int n;
        cin >> n;

        string s;
        cin >> s;

        int kpo = 0, ko = 0, kz = 0;
        for (int i = 0; i < s.size(); i++)
        {
            if (s[i] == '1')
            {
                ko++;
            }
            else
            {
                kpo += ko / 2;
                ko = 0;
                kz++;
            }
        }
        kpo += ko / 2;

        cout << (fact[kpo + kz] * pow((fact[kpo] * fact[kz]) % MOD, MOD - 2)) % MOD << endl;
    }
}
