#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<assert.h>
#include<set>
#include<ctime>
#include<queue>

using namespace std;
#define M 100005
#define N
#define MP make_pair
#define debug() cerr<<"Why So Serious?"
typedef long long ll;
typedef unsigned long long ull;
typedef double db;

template<class T>
void Rd(T &x) {
    x = 0;
    char c;
    while (c = getchar(), c < 48);
    do x = (x << 1) + (x << 3) + (c ^ 48);
    while (c = getchar(), c > 47);
}
const int md=998244353;
int n;
char str[M];
ll Fac[M];
ll Inv[M];
int main() {
    int _;
    Fac[0]=Fac[1]=Inv[0]=Inv[1]=1;
    for(int i=2;i<M;++i){
        Fac[i]=Fac[i-1]*i%md;
        Inv[i]=(md-md/i)*Inv[md%i]%md;
    }
    for(int i=1;i<M;++i)Inv[i]=Inv[i-1]*Inv[i]%md;
    for(Rd(_);_;_--){
        Rd(n);
        scanf("%s",str+1);
        int sum1=0,sum2=0;
        for(int i=1;i<=n;++i){
            if(str[i]=='1'){
                int j=i+1;
                for(;j<=n&&str[j]=='1';++j);
                sum2+=(j-i)/2;
                i=j-1;
            }else sum1++;
        }
        printf("%lld\n",Fac[sum1+sum2]*Inv[sum1]%md*Inv[sum2]%md);
    }
    return 0;
}
