#include <bits/stdc++.h>
#define ar array

using namespace std;
using ll = long long;

template<typename T>
struct modnum {
  using Int = typename T::type;
  using Int2 = typename T::prod_type;
  Int val;

  modnum() = default;
  modnum(const Int &_val) : val((_val%T::MOD+T::MOD)%T::MOD) {}

  modnum &operator++() { if (++val == T::MOD) val = 0; return *this; }
  modnum &operator--() { if (val-- == 0) val += T::MOD; return *this; }
  modnum &operator++(int) { auto ret = *this; ++*this; return ret; }
  modnum &operator--(int) { auto ret = *this; --*this; return ret; }

  modnum &operator+=(const modnum &o) { if ((val += o.val) >= T::MOD) val -= T::MOD; return *this; }
  modnum &operator-=(const modnum &o) { if ((val -= o.val) < 0) val += T::MOD; return *this; }
  modnum &operator*=(const modnum &o) { val = Int((Int2)val*o.val%T::MOD); return *this; }
  modnum &operator/=(const modnum &o) { *this *= o.inv(); return *this; }

  friend modnum operator+(const modnum &a, const modnum &b) { auto ret = a; return ret += b; }
  friend modnum operator-(const modnum &a, const modnum &b) { auto ret = a; return ret -= b; }
  friend modnum operator*(const modnum &a, const modnum &b) { auto ret = a; return ret *= b; }
  friend modnum operator/(const modnum &a, const modnum &b) { auto ret = a; return ret /= b; }

  friend bool operator==(const modnum &a, const modnum &b) { return a.val == b.val; }
  friend bool operator!=(const modnum &a, const modnum &b) { return a.val != b.val; }

  modnum pow(ll e) const {
    modnum b = *this, a = 1;
    while (e) {
      if (e&1) a *= b;
      b *= b;
      e >>= 1;
    }
    return a;
  }

  modnum inv() const { return pow(T::MOD-2); }

  friend istream &operator>>(istream &is, modnum &x) { Int v; is >> v; x = v; return is; }
  friend ostream &operator<<(ostream &os, const modnum &x) { return os << x.val; }
};

struct _static_mod_t {
  using type = int;
  using prod_type = ll;
  static constexpr type MOD = 998244353;
};

using mint = modnum<_static_mod_t>;

const int mxF = 1e6;
mint fac[mxF];

mint C(int n, int k) {
  if (k < 0) return 0;
  if (k > n) return 0;
  return fac[n] / (fac[n-k] * fac[k]);
}

int main() {
  cin.tie(0)->sync_with_stdio(0);

  fac[0] = 1;
  for (int f = 1; f < mxF; ++f)
    fac[f] = fac[f-1] * f;

  int T; cin >> T; while (T--) {
    int n; cin >> n;
    string s; cin >> s;

    int state = 0;
    int mv = 0;
    int space = 0;
    for (char c : s) {
      if (c == '1') {
        if (state == 1)
          ++mv, state = 0;
        else state = 1;
      } else {
        state = 0;
        ++space;
      }
    }


    cout << C(mv+space, mv) << '\n';
  }
}
