#include <bits/stdc++.h>
#define reg register
#define fi first
#define se second
#define mp std::make_pair
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int rd()
{
    reg int x=0,f=0;
    reg char ch=getchar();
    while(!isdigit(ch)) (ch=='-')&&(f=1),ch=getchar();
    while(isdigit(ch)) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
    return f?-x:x;
}
const int MAXN=1e5+10;
const int mod=998244353;
int n;
char s[MAXN];
ll fac[MAXN],inv[MAXN];
void init()
{
	fac[0]=fac[1]=inv[0]=inv[1]=1;
	for(reg int i=2;i<MAXN;++i) fac[i]=1ll*fac[i-1]*i%mod,inv[i]=1ll*(mod-mod/i)*inv[mod%i]%mod;
	for(reg int i=2;i<MAXN;++i) inv[i]=inv[i-1]*inv[i]%mod;
}
ll C(reg int n,reg int m)
{
	return fac[n]*inv[m]%mod*inv[n-m]%mod;
}
void work()
{
	n=rd();
	scanf("%s",s+1);
	int cnt1=0,cnt2=0;
	for(reg int i=1;i<=n;++i)
	{
		if(s[i]=='1'&&s[i+1]=='1') ++cnt1,++i;
		else if(s[i]=='0') ++cnt2;
	}
	ll ret=C(cnt1+cnt2,cnt2);
	printf("%lld\n",ret);
}
int main()
{
    int _=1;
    init();
    _=rd();
    while(_--) work();
    return 0;
}