#include<bits/stdc++.h>

using namespace std;

#define task "sol"
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define zs(v) ((int)(v).size())
#define BIT(x, i) (((x) >> (i)) & 1)
#define CNTBIT __builtin_popcountll
#define ALL(v) (v).begin(),(v).end()
#define endl '\n'

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;

const int dx[4]={-1, 0, 1, 0}, dy[4]={0, 1, 0, -1};
const int dxx[8]={-1, -1, 0, 1, 1, 1, 0, -1}, dyy[8]={0, 1, 1, 1, 0, -1, -1, -1};
const ll mod=998244353 ; /// 998244353
const int base=311;

ll fpow(ll n, ll k)
{
    if (!k) return 1;
    ll t=fpow(n,k/2);
    if (k&1) return t*t%mod*n%mod;
    else return t*t%mod;
}
ll choose(int k, int n)
{
    ll tu=1, mau=1;
    for (int i=n-k+1;i<=n;++i) tu=tu*i%mod;
    for (int i=1;i<=k;++i) mau=mau*i%mod;
    return tu*fpow(mau,mod-2)%mod;
}
void gogo()
{
    int n;
    string s;
    cin>>n>>s;
    s=" "+s;
    int ones=0, zeros=0;
    for (int i=1;i<=n;++i)
    {
        if (s[i]=='1')
        {
            int j=i;
            while (j+1<=n&&s[j+1]==s[i]) j++;
            int len=j-i+1;
            ones+=len/2;
            i=j;
        }
        zeros+=s[i]=='0';
    }

    cout<<choose(ones,zeros+ones)<<endl;
}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    if(fopen(task".inp", "r"))
    {
        freopen(task".inp", "r", stdin);
        freopen(task".out", "w", stdout);
    }
    int t;
    cin>>t;
    while (t--) gogo();
}






