#include <bits/stdc++.h>
using namespace std;
#define ll long long //__int64 __int128
#define ull unsigned long long
#define pb push_back
#define eb emplace_back
#define mst(a, b) memset(a, b, sizeof(a))
#define mCase int T_Case; cin>>T_Case; for(int Case=1;Case<=T_Case;++Case)
#define qm(a, b) (a-a/b*b)
#define mCase int T; scanf("%d", &T); for(int Case=1;Case<=T;++Case)
//srand(time(NULL)); srand(rand()); srand(rand());

const double PI=acos(-1.0);

/*
int P_num[700005], P_cnt; //664579 in 1e7, 5761455 in 1e8
bool isP[10000007];

void GetPrime(int Pn){
	memset(isP, 1, sizeof(isP)), isP[1]=P_cnt=0;
	for(int i=2;i<=Pn;++i){
		if(isP[i]) P_num[++P_cnt]=i;
		for(int j=1;j<=P_cnt && i*P_num[j]<=Pn;++j){
			isP[i*P_num[j]]=0;
			if(!qm(i, P_num[j])) break;
		}
	}
}
*/

//gcd(a,b)*lcm(a,b)=a*b
ll GCD(ll a, ll b, ll t=1){ while(b){ t=b;b=a-a/b*b; a=t;} return a;}
ll LCM(ll a, ll b){ return a/GCD(a, b)*b;}

ll qmul(ll a, ll b, ll p=1000000007){ ll r=0; while(b){ if(b&1) r=(r+a)%p; b>>=1; a=(a+a)%p;} return r;}
ll Kpow(ll x, ll n, ll p=1000000007){ ll r=1; for(;n;n>>=1, x=qm(x*x, p)) if(n&1) r=qm(r*x, p); return r;}

const double eps=1e-6;
#define P pair<ll, ll>
const long long LINF=0x3f3f3f3f3f3f3f3f; //0x7f7f7f7f7f7f7f7f

const int mod=998244353; // 998244353
const int INF=0x3f3f3f3f; //0x7f7f7f7f
const int maxn=200005;

ll n;
ll s[maxn];
ll t[maxn];

ll inv[maxn];
ll fac[maxn];

ll C(ll x, ll y){
    return fac[y]*inv[y-x]%mod*inv[x]%mod;
}

void work(){
    cin>>n;
    bool pre=0;
    string str; cin>>str;
    int cnt=0, tot=0;
    for(int i=0;i<n;++i){
        if(str[i]=='0') cnt++, pre=0;
        else if(str[i]=='1'){
            if(pre) tot++, pre=0;
            else pre=1;
        }
    }
    //cout<<tot<<' '<<cnt<<' '<<endl;
    cout<<C(tot, tot+cnt)<<'\n';
}

int main(){
    inv[0]=fac[0]=1;
    for(int i=1;i<=100000;++i) inv[i]=inv[i-1]*Kpow(i, mod-2, mod)%mod, fac[i]=fac[i-1]*i%mod;
	mCase{ work();}
	//work();

	return 0;
}

/*
5
1
1
2
2 1
3
3 2 1
4
4 3 2 1
5
5 4 3 2 1
*/
