#include<bits/stdc++.h>

#define int long long
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(),x.end()

const double eps=1e-7,PI=3.1415926;
const int N=1e6+10,M=998244353;

using namespace std;

int n,q,m,k,x,y,a[N],mx=-1,mn=1e9,sum;
string s,s1,s2;
map < int , int > mp;
vector < int > vec;
int preinv[N],inv[N],fac[N];

int C(int x,int y){
    int ret=fac[x]*inv[y]%M;
    ret=(ret*inv[x-y])%M;
    return ret;
}

int POW(int a,int b){
    if (b==0)return 1;
    int ret=(POW(a,b/2));
    ret=(ret*ret)%M;
    if (b&1)return (ret*a)%M;
    return ret;
}
int32_t main(){
    fac[0]=1,inv[0]=1;
    preinv[1]=preinv[0]=1;
    for (int i=2;i<N;i++)preinv[i]=((M-M/i)*preinv[M%i])%M;
    for (int i=1;i<N;i++){
        fac[i]=(fac[i-1]*i)%M;
        inv[i]=preinv[i]*inv[i-1]%M;
    }
    cin>>q;
    while (q--){
        cin>>n>>s;
        int cnt=0,tot=0;
        sum=0;
        for (int i=0;i<n;i++){
            if (s[i]=='0'){
                sum++;
                tot+=cnt-cnt%2;
                cnt=0;
            }
            else cnt++;
        }
        tot+=cnt-cnt%2;
        cout<<C(tot/2+sum,sum)<<endl;
    }
    return 0;
}
