#include <bits/stdc++.h>


using namespace std;

using ll = long long;
using pii = pair<int, int>;
using ld = long double;

template <typename T>
int sz(T &x) {
  return (int)(x.size());
}

int power(int x, int y, int mod) {
  if (y == 0) {
    return 1;
  }
  int z = power(x, y >> 1, mod);
  z = z * 1ll * z % mod;
  if (y & 1) {
    z = z * 1ll * x % mod;
  }
  return z;
}

const int mod = 998244353;
const int inf = 1000000007;

const int MX = (int)4e5;
int f[MX], rf[MX];

void precalc() {
  f[0] = 1;
  for (int i = 1; i < MX; ++i) {
    f[i] = f[i - 1] * 1ll * i % mod;
  }
  rf[MX - 1] = power(f[MX - 1], mod - 2, mod);
  for (int i = MX - 2; i >= 0; --i) {
    rf[i] = rf[i + 1] * 1ll * (i + 1) % mod;
  }
}

int choose(int n, int k) {
  if (n < k) {
    return 0;
  }
  return (f[n] * 1ll * rf[k] % mod) * rf[n - k] % mod;
}


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

  string t;
  int cntmove = 0;
  for (int i = 0; i + 1 < n; ++i) {
    if (s[i] == '1' && s[i + 1] == '1') {
      s[i] = '?';
      s[i + 1] = '?';
      cntmove++;
    }
  }
  int cntzero = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] != '?') {
      cntzero += s[i] == '0';
    }
  }

  cout << choose(cntzero + cntmove, cntmove) << "\n";


}


int main() {

  #ifndef LOCAL58
    // don't forget to remove if interactive
    ios_base :: sync_with_stdio(false);
    cin.tie(nullptr);
  #endif


  precalc();

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


  return 0;
}
