#ifdef ONLINE_JUDGE
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#endif
#include <bits/stdc++.h>
#define speed                   \
  ios_base::sync_with_stdio(0); \
  cin.tie(0);                   \
  cout.tie(0);
#define precision     \
  cout.precision(30); \
  cerr.precision(10);
#define ll long long
#define ld long double
#define pb(x) push_back(x)
#define sz(x) (int)x.size()
#define mp(x, y) make_pair(x, y)
#define all(x) x.begin(), x.end()
#define pc(x) __builtin_popcount(x)
#define pcll(x) __builtin_popcountll(x)
#define F first
#define S second
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
void ioi(string name) {
  freopen((name + ".in").c_str(), "r", stdin);
  freopen((name + ".out").c_str(), "w", stdout);
}
const ll mod = 998244353;
ll n, f[100005];
string s;
ll bpow(ll x, ll y) {
  ll z = 1;
  while (y > 0) {
    if (y & 1) z = (z * x) % mod;
    x = (x * x) % mod;
    y /= 2;
  }
  return z;
}
ll cnk(ll n, ll k) {
  return (((f[n] * bpow(f[n - k], mod - 2)) % mod) * bpow(f[k], mod - 2)) % mod;
}
ll count(ll x, ll y) { return cnk(x + y - 1, y - 1); }
void solve() {
  ll a = 0, b = 0;
  cin >> n >> s;
  // 11's can move wherever
  // 1's stay in place
  // 0's can become 1's
  // ans = number of ways to place 11's onto the field
  // imagine s as '00...' + '11' + '00...' + '11' + '00...' + ...
  // count of 0's in all blocks is equal to n - 1's - 11's * 2
  // there will be 11's + 1 blocks of 0's
  // the task is reduced to counting the number of ways
  // to get a sum X using Y nonnegative terms
  // in our case X is count of 0's and Y is count of blocks of 0's
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') continue;
    if (i < n - 1 && s[i + 1] == '1') {
      b++;
      i++;
    } else {
      a++;
    }
  }
  cout << count(n - a - b * 2, b + 1) << "\n";
}
int main() {
  speed;
  precision;
  // code
  f[0] = 1;
  for (int i = 1; i <= 100000; i++) f[i] = (f[i - 1] * i) % mod;
  int T;
  cin >> T;
  while (T--) solve();
    // endl
#ifndef ONLINE_JUDGE
  cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}