#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N =1e5 + 10,mod = 998244353;
ll t, n, f[N];
string s;
ll quickpow(ll a, ll b) 
{
    ll sum = 1;
    while(b) 
	{
        if(b&1)sum=sum*a%mod;
        a = a*a%mod;
        b >>= 1;
    }
    return sum;
}
ll 	CC(int a, int b) 
{
    return f[a] * quickpow((ll) f[b] * f[a - b] % mod, mod - 2) % mod;
}
void solve() {
    cin >> n >> s;
    int m = 0;
    for (int i = 1; s[i]; i++)
        if (s[i - 1] == '1' && s[i] == '1')m++, i++;
    n = m << 1;
    for (int i = 0; s[i]; i++)n += (s[i] == '0');
    cout << CC(n - m, m) << endl;
}
int main() 
{
    f[0] = 1;
    for (int i = 1; i < N; i++)f[i] = f[i - 1] * i%mod;
    cin >> t;
    while (t--) solve();
    return 0;
}

