// ████████▄   ▄█   ▄█    █▄  ▄██   ▄      ▄████████ ███▄▄▄▄      ▄████████    ▄█    █▄ 
// ███   ▀███ ███  ███    ███ ███   ██▄   ███    ███ ███▀▀▀██▄   ███    ███   ███    ███ 
// ███    ███ ███▌ ███    ███ ███▄▄▄███   ███    ███ ███   ███   ███    █▀    ███    ███ 
// ███    ███ ███▌ ███    ███ ▀▀▀▀▀▀███   ███    ███ ███   ███   ███         ▄███▄▄▄▄███▄▄ 
// ███    ███ ███▌ ███    ███ ▄██   ███ ▀███████████ ███   ███ ▀███████████ ▀▀███▀▀▀▀███▀ 
// ███    ███ ███  ███    ███ ███   ███   ███    ███ ███   ███          ███   ███    ███ 
// ███   ▄███ ███  ███    ███ ███   ███   ███    ███ ███   ███    ▄█    ███   ███    ███   
// ████████▀  █▀    ▀██████▀   ▀█████▀    ███    █▀   ▀█   █▀   ▄████████▀    ███    █▀ 

// #pragma GCC optimize "trapv"

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

#define pb push_back
#define fo(i,a,b) for(int i=a ; i<b ; i++)
#define foe(i,a,b) for(int i=a ; i<=b ; i++)
#define endl '\n'
#define ff first
#define ss second
#define MOD 1000000007

#define NUM 998244353

typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

ll modExp(ll b, ll e)
{
    if(e==0) return 1;
    if(e%2==0) return modExp((b*b)%NUM,e/2);
    else return (b*modExp((b*b)%NUM,(e-1)/2))%NUM;
}

ll modInv(ll x)
{
    return modExp(x, NUM-2);
}

ll ncr(ll n, ll r)
{
    r = min(r, n-r);
    ll ans = 1;
    ll den=1;
    for(ll i=1 ; i<=r ; i++)
    {
        ans = (ans*((n-i+1)%NUM))%NUM;
        den = (den*i)%NUM;
    }
    ans = (ans*modInv(den))%NUM;
    return ans;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t; cin>>t;
    while(t--)
    {
        int n; cin>>n;
        string s; cin>>s;
        ll z=0, g=0;
        int curr=0;
        fo(i,0,n)
        {
            if(s[i] == '1') curr++;
            else
            {
                z++;
                g += curr/2;
                curr=0;
            }
        }
        g += curr/2;
        //cout<<g<<" "<<z<<" ";
        cout<<ncr(g+z,z)%NUM<<endl;
    }
    
    return 0;
}