#include<bits/stdc++.h>
using namespace std;
const long long N = 2e6 + 5;
const long long MOD = 998244353;
long long fact[N], invfact[N];
long long lgcput(long long b, long long p){
  long long a = 1;
  while(p){
    if(p & 1){
      a*=b;
      a%=MOD;
    }
    p/=2;
    b*=b;
    b%=MOD;
  }
  return a;
}
void prec(){
  fact[0] = 1;
  for(long long i =1 ; i < N; i++)
    fact[i] = (1LL * fact[i - 1] * i )% MOD;
  invfact[N - 1] = lgcput(fact[N - 1], MOD - 2);
  for(long long i = N - 2; i >=0; i--){
    invfact[i] = (1LL * invfact[i + 1] * (i + 1)) % MOD;
  }
}
long long getans(long long lin, long long col){
  if(lin == 0 || col == 0)
    return 1;
  long long ans = fact[lin + col - 2];
  ans *= 1LL*invfact[lin - 1];
  ans %= MOD;
  ans *= 1LL*invfact[col - 1];
  ans %= MOD;
  return ans;
}

void solve(){
  long long n;
  string s;
  cin>>n>>s;
  s= " " + s;
  long long last = 0 ;
  long long nr0 = 0;
  long long nrstr = 0;
  for(long long i = 1; i<=n; i++){
    if(s[i] == '0'){
      nr0++;
      if(last == 0){
        last = i;
        continue;
      }
      if((i%2 == last%2) || (i%2 == 1 && last%2 == 0))
         nrstr++;
      last = i;
    }
  }
  long long great = n / 2;
  if(n%2 == 1 && last%2 == 1)
    great++;
  cout<<getans(nr0 + 1, great - nrstr)<<"\n";
}
int main()
{
  //freopen(".in","r",stdin);
  prec();
  ios::sync_with_stdio(false);
  cin.tie(0),cout.tie(0);
  long long nrt;
  cin>>nrt;
  for(long long i=1;i<=nrt;i++){
    solve();
  }
  return 0;
}
