#include <bits/stdc++.h>

using namespace std;

string s;
const long long mo = 998244353;
long long jie[200005];

long long ksm(long long base, long long mi)
{
    long long ans = 1ll;
    while(mi)
    {
        if(mi&1ll)
            ans = ans * base % mo;
        mi >>= 1ll;
        base = base * base % mo;
    }
    return ans;
}

long long C(long long a, long long b)
{
    return jie[a]*ksm(jie[a-b], mo-2)%mo*ksm(jie[b], mo-2)%mo;
}

int main()
{
    int t, n, m;
    jie[0] = 1;
    for(register int i = 1; i <= 200000; i += 1)
        jie[i] = jie[i-1] * i % mo;
    cin >> t;
    while(t--)
    {
        cin >> n;
        cin >> s;
        int zer = 0, yi = 0, bi = 0;
        for(register int i = 0; i < n; i += 1)
        {
            if(s[i] == '1')
                bi += 1;
            else if(s[i] == '0')
                zer += 1, yi += bi/2, bi = 0;
        }
        yi += bi/2;
        cout << C(zer+yi, zer) << endl;
    }
    //cout << C(5, 2) << endl;
    return 0;
}
