#include <iostream>
#include <map>
#include <string>
#include <cstring>
#include <stack>
#include <queue>

const int MAXN = 1e6;
const long long mod = 998244353;
using namespace std;
long long inv[MAXN];

long long ctr(long long a, long long b) {
    long long res = 1;
    for (int i = 0; i < b; i++) {
        res *= (a - i);
        res %= 998244353;
        res *= inv[i + 1];
        res %= 998244353;
    }
    return res % 998244353;
}

int main() {
#ifdef ONLINE_JUDGE
#else
    freopen("../in.txt", "r", stdin);
#endif
    int num;
    scanf("%d", &num);
    inv[1] = 1;
    for (int i = 2; i <= 100000; ++i) {
        inv[i] = inv[mod % i] * (mod - mod / i) % mod;
    }
//    for(int i=0;i<10;i++){
//        cout<<inv[i]<<" ";
//    }
//    cout<<endl;
    while (num--) {
        int length;
        string a;
        cin >> length >> a;
        long long num1 = 0;
        long long num0 = 0;
        for (int i = 0; i < length; i++) {
            if (i > 0 && a[i] == '1' && a[i - 1] == '1') {
                a[i - 1] = '-';
                a[i] = '-';
                num1++;
            } else if (a[i] == '0') {
                num0++;
            }
        }
//        cout << num1 << " " << num0 << endl;
        cout << ctr(num1 + num0, num0) << endl;
    }
    return 0;
}