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

const int mod=1e9+7;

int pw(int a,int t=mod-2){
    int x=1;
    while(t>0){
        if(t&1)x=x*a%mod;
        a=a*a%mod,t/=2;
    }
    return x;
}
int32_t main(){
    ios::sync_with_stdio(0),cin.tie(0);
    int n,m,s=0,ans=1;
    cin >> n >> m;
    for(int i=0;i<n;i++){
    	int x;
    	cin >> x;
    	s+=x;
    }
    s+=n,m+=n;
    for(int i=1;i<=s;i++){
    	ans=ans*(m-i+1)%mod;
    	ans=ans*pw(i)%mod;
    }
    cout << ans;
}
#include <bits/stdc++.h>

using namespace std;

#define ll int64_t

const int mod = 998244353;
int inc(int x, int y) { return x + y >= mod ? x + y - mod : x + y; }
namespace math
{
    int qpow(int a, int x, int mo)
    {
        int res = 1;
        while (x)
        {
            if (x & 1)
                res = 1ll * res * a % mod;
            a = 1ll * a * a % mod;
            x >>= 1;
        }
        return res;
    }
    vector<int> Fac, invFac;
    void Finit(int n)
    {
        Fac.resize(n + 1);
        invFac.resize(n + 1);
        Fac[0] = 1;
        invFac[0] = 1;
        for (int i = 1; i <= n; i++)
            Fac[i] = 1ll * Fac[i - 1] * i % mod;
        invFac[n] = qpow(Fac[n], mod - 2, mod);
        for (int i = n - 1; i >= 1; i--)
            invFac[i] = 1ll * invFac[i + 1] * (i + 1) % mod;
    }
    int C(int n, int m)
    {
        if (m == 0)
            return 1;
        if (n < m || m < 0)
            return 0;
        return (int)(1ll * Fac[n] * invFac[m] % mod * invFac[n - m] % mod);
    }
}

void solve()
{
    int n, m;
    cin >> n >> m;
    math::Finit(n);
    vector<vector<int>> dp(14, vector<int>(n + 1));
    dp[0][0] = 1;
    for (int t = 0; t < 13; t++)
    {
        for (int k = 0; k <= n; k++)
        {
            for (int j = 0; j <= n; j += 2)
            {
                if (((j + k) & 1) == (m >> t & 1))
                {
                    dp[t + 1][(j + k) / 2] = inc(dp[t + 1][(j + k) / 2], 1ll * math::C(n, j) * dp[t][k] % mod);
                }
            }
        }
    }

    //cout << dp[0][0] << endl;
    cout << dp[13][0] << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T = 1;

    while (T--)
    {
        solve();
    }
}