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

#define int long long
#define mod 998244353
#define pb push_back
#define ss second
#define ff first
#define all(v) v.begin(), v.end()
#define deb(...) __logger(#__VA_ARGS__, __VA_ARGS__)
template <typename... Args> 
void __logger(string vars, Args &&...values) {
    cerr << "\n" << vars << " = ";
    string delim = "";
    (..., (cerr << delim << values, delim = ", "));
    cerr << "\n";
}
#define w(x) \
    int x;     \
    cin >> x;  \
    while (x--)

const int N = 1e5 + 2;
int fact[N];

int pwmd(int n, int m) {
  int res = 1;
  while (m > 0) {
    if (m & 1)
      res = (res % mod * n % mod) % mod;
    m /= 2;
    n = (n % mod * n % mod) % mod;
  }

  return res;
}


int C(int n,int r) {
    if(r > n) return 0;
    int ans = fact[n];
    ans = (ans * pwmd(fact[r],mod - 2)) % mod;
    ans = (ans * pwmd(fact[n - r],mod - 2)) % mod;
    return ans;
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);  
    fact[0] = 1;
    for(int i = 1; i < N; ++i)
        fact[i] = (fact[i - 1] * i) % mod;

    w(tt) {
        int n;
        cin >> n;
        string s;
        cin >> s;

        int ones = 0,z = 0;
        int cur = 0;
        for(int i = 0; i < n; ++i) {
            if(s[i] == '1') cur++;
            else {
                cur = 0;
                z++;
            }
            if(cur == 2) {
                ones++;
                cur = 0;
            }
        }
        ones += cur / 2;
        int ans = 0;
        for(int i = 1; i <= ones; ++i) {
            int cur = (C(z + 1,i) * C(ones - 1,i - 1) % mod) % mod;
            ans = (ans + cur) % mod;
        }
        cout << max(1ll,ans) << "\n";
    }

    return 0;
}

// 11 11 11 11 100000100010

// 0000100001

// 1000001000

// pairs = 5, pos = 9