#include<bits/stdc++.h>
#include <time.h>
#include <cstdlib>
#include <ctime>
#include <unistd.h>
using namespace std;
 
#define int long long
typedef pair<int, int> pi;
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL);}
int mod = 998244353;
 
int prime[1000001];
vector<int> fact;
 
void SieveOfEratosthenes(int n = 1e6+1)
{
    memset(prime, true, sizeof(prime));
 
    for (int p = 2; p * p <= n; p++)
    {
        if (prime[p] == true) 
        {
            for (int i = p * p; i <= n; i += p)
                prime[i] = false;
        }
    }
}
 
void factorial()
{
	fact = vector<int>(1e6);
	fact[0]=1;
	for(int i=1;i<1e6;i++)
	{
		fact[i] = (fact[i-1]*i)%mod;
	}
}
 
int power(int x, int y, int p)
{
    int res = 1; // Initialize result
 
    x = x % p; // Update x if it is more than or
    // equal to p
 
    while (y > 0) 
    {
     
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res * x) % p;
 
        // y must be even now
        y = y >> 1; // y = y/2
        x = (x * x) % p;
    }
    return res;
}
 
// Returns n^(-1) mod p
int modInverse(int n, int p)
{
    return power(n, p - 2, p);
}
 
bool compare(pair<int,int> p1, pair<int,int> p2)
{
	return p1.second < p2.second;
}
 
bool ispallindrome(string s)
{
	int i=0;
	int j = s.length()-1;
 
	while(i<j)
	{
		if(s[i] != s[j])
			return false;
		i++;
		j--;
	}
 
	return true;
}

bool isPrime(int n)
{
    if (n <= 1)  return false;
    if (n <= 3)  return true;
   
    // This is checked so that we can skip 
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;
   
    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;
   
    return true;
}

/*

To solve this, we will follow these steps −
k := len of string
n := quotient of k/2
x := number of unique characters in s
return x^(n + k mod 2)

*/

int nCrModPFermat(int n,int r, int p)
{
    // If n<r, then nCr should return 0
    if (n < r)
        return 0;
    // Base case
    if (r == 0)
        return 1;
 
    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    
    return (fact[n] * modInverse(fact[r], p) % p
            * modInverse(fact[n - r], p) % p)
           % p;
}

int32_t main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
 
	send help

	int t = 1;
    cin>>t;
    factorial();
    
    while(t--){
        int n;
        cin>>n;

        string s;
        cin>>s;

        
        int total = 0;

        if(n < 3){
            cout<<1<<"\n";
            continue;
        }

        for(int i=0;i<n;i++){
            total += (s[i] == '1');
        }

        int cnt = 0;
        int add = 0;
        for(int i=0;i<n;i++){
            if(s[i] == '1'){
                cnt++;
            } else {
                add += cnt/2;
                cnt = 0;
            }
        }

        add += cnt/2;

        int zero = n-total;
        int up = add+zero;
        int p = 998244353;
        cout<<nCrModPFermat(up, zero, p)<<"\n";
    }
 
	return 0;
}