#include <bits/stdc++.h>

#define N (int) 3005
#define MOD 998244353

using namespace std;
int n, k;

int dp[N][N];
int main () {
    cin >> n >> k;

    dp[0][0] = 1;
    for (int i = 1; i <= n; i ++) {
        for (int j = i; j >= 1; j --) {
            dp[i][j] = (dp[i-1][j-1] + ((j<<1) <= i ? dp[i][j<<1] : 0)) % MOD;
        }
    }

    cout << dp[n][k] << endl;

    return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <array>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <cstring>
#include <unordered_map>
using namespace std;

using ll = long long;
using P = pair<int, int>;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

template<class T>
inline bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

struct mint {
    int x;
    mint() : x(0) {}
    mint(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
    mint& operator+=(const mint& p){
        if((x += p.x) >= mod)   x -= mod;
        return *this;
    }
    mint& operator-=(const mint& p){
        if((x -= p.x) < 0)  x += mod;
        return *this;
    }
    mint& operator*=(const mint& p){
        x = (int)(1LL * x * p.x % mod);
        return *this;
    }
    mint& operator/=(const mint& p){
        *this *= p.inverse();
        return *this;
    }
    mint operator-() const { return mint(-x); }
    mint operator+(const mint& p) const { return mint(*this) += p; }
    mint operator-(const mint& p) const { return mint(*this) -= p; }
    mint operator*(const mint& p) const { return mint(*this) *= p; }
    mint operator/(const mint& p) const { return mint(*this) /= p; }
    bool operator==(const mint& p) const { return x == p.x; }
    bool operator!=(const mint& p) const { return x != p.x; }
    mint pow(int64_t n) const {
        mint res = 1, mul = x;
        while(n > 0){
            if(n & 1)   res *= mul;
            mul *= mul;
            n >>= 1;
        }
        return res;
    }
    mint inverse() const { return pow(mod - 2); }
    friend ostream& operator<<(ostream& os, const mint& p){
        return os << p.x;
    }
    friend istream& operator>>(istream& is, mint& p){
        int64_t val;
        is >> val;
        p = mint(val);
        return is;
    }
};

template<typename T>
struct Combination{
    int sz;
    vector<T> fact_;
    vector<T> ifact_;
    vector<T> inv_;
    
    Combination(int n = 1e+7) : sz(n) {
        fact_.resize(sz + 1);
        ifact_.resize(sz + 1);
        inv_.resize(sz + 1);

        fact_[0] = ifact_[sz] = inv_[0] = 1;
        for(int i = 1; i <= sz; ++i)    fact_[i] = fact_[i - 1] * i;
        ifact_[sz] /= fact_[sz];
        for(int i = sz; i > 0; --i)     ifact_[i - 1] = ifact_[i] * i;
        for(int i = 1; i <= sz; ++i)    inv_[i] = ifact_[i] * fact_[i - 1];
    }

    inline T fact(int k) const {
        if(k < 0 || k > sz) return 0;
        return fact_[k];
    }
    inline T ifact(int k) const {
        if(k < 0 || k > sz) return 0;
        return ifact_[k];
    }
    inline T inv(int k) const {
        if(k < 0 || k > sz) return 0;
        return inv_[k];
    }

    T get_permutation(int n, int k){
        if(n < 0 || k < 0 || n < k)     return 0;
        return fact(n) * ifact(n - k);
    }

    T get_combination(int n, int k){
        if(n < 0 || k < 0 || n < k)     return 0;
        return fact(n) * ifact(k) * ifact(n - k);
    }
};

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

    int N, M, A;
    cin >> N >> M;
    ll S = 0;
    for(int i = 0; i < N; ++i){
        cin >> A;
        S += A;
    }
    if(M < S){
        cout << 0 << endl;
        return 0;
    }
    Combination<mint> C;
    mint ans = 1;
    M += N;
    for(int i = 1; i <= S + N; ++i) ans *= mint(M - i + 1) * C.inv(i);
    cout << ans << endl;
}