#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef unsigned long long ull;
const int inf = 0x3f3f3f3f;
const long long INF = 1e18;
const int maxn = 2e5 + 7;
const ll mod = 998244353;

#define pb push_back
#define debug(x) cout << #x << ":" << x << endl;
#define mst(x, a) memset(x, a, sizeof(x))
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define dep(i, a, b) for (int i = (a); i >= (b); --i)

inline ll read() {
    ll x = 0;
    bool f = 0;
    char ch = getchar();
    while (ch < '0' || '9' < ch)
        f |= ch == '-', ch = getchar();
    while ('0' <= ch && ch <= '9')
        x = x * 10 + ch - '0', ch = getchar();
    return f ? -x : x;
}

ll n ,a[maxn];
ll fun[maxn],inv[maxn];
ll C(ll n,ll m) {
	if(n<m) return 0;
	if(m==0) return 1;
	if(n==m) return 1;
	return (fun[n]*inv[n-m]%mod)*inv[m]%mod;
}
ll qpow(ll a,ll b) {
	ll ans=1;
	while(b) {
		if(b&1) ans=ans*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return ans;
}
void yu() {
	inv[1]=1,fun[1]=1,fun[0]=1;
	for(int i=2; i<maxn; i++) fun[i]=fun[i-1]*i%mod;
	inv[maxn-1]=qpow(fun[maxn-1],mod-2);
	for(int i=maxn-2; i>=0; i--) inv[i]=inv[i+1]*(i+1)%mod;
}

int main() {
    // ios::sync_with_stdio(false);
    yu();
    int _;
    cin >> _;
    while (_--) {
        n = read();
        rep(i, 1, n) scanf("%1d", &a[i]);
        ll one =0 ,zero =0 ,ii = 1;
        for( ii=1 ;ii<=n ;ii++)
        {
        	int t= 0;
        	if(!a[ii]) zero++;
        	else {
        		while(a[ii]) t++,ii++;
        		one+=t/2;
        		ii--;
        	}
        }
      // one++;
        cout<<C(zero+one,one)<<endl;
        
    }
    return 0;
}
/*


*/
