#include<bits/stdc++.h>
using namespace std;

#define int long long 
#define endl '\n' 

const int mod = 998244353;

int power(int b, int p) {
  int ans = 1;
  while (p) {
    if (p & 1) {
      ans = (ans * b) % mod;
      p--;
    }
    b = (b * b) % mod;
    p /= 2;
  }
  return ans;
}

int fact[100005];
int inv_fact[100005];
void pre_com() {
  fact[0] = 1;
  inv_fact[0] = 1;
  for (int i = 1; i < 100005; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
    inv_fact[i] = power(fact[i], mod - 2);
    // cout << fact[i] << " " << inv_fact[i] << endl;
  }
}

int n;
string str;
void solve() {
  cin >> n >> str;

  int cnt0 = 0, cnt1p = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] == '0') cnt0++;
    else if (i + 1 < n and str[i + 1] == '1') {
      cnt1p++;
      i++;
    }
  }
  cout << fact[cnt0 + cnt1p] * inv_fact[cnt0] % mod * inv_fact[cnt1p] % mod << endl; 
}

signed main()
{
  ios::sync_with_stdio(0);
  cin.tie(0);
  
  pre_com();

  int tt = 1;
  cin >> tt;
  while (tt--) {
    solve();
  }

  return 0;
}