#include<bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll INF=(1LL<<62);
const ld pi=acosl((ld)-1);
const ll mod = 1000000007;
// const ll mod = 1234567;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"
#define TO_STRING(VariableName) # VariableName

template <typename T>ostream &operator<<(ostream &out,const vector<T> &v) {rep(i,(int)v.size()-1)cout<<v[i]<<" ";cout<<v[(int)v.size()-1];return out;}
template <typename T1, typename T2>ostream &operator<<(ostream &out, const map<T1, T2> &p) {out << "(" << p.first << ", " << p.second << ")";return out;}
template <typename T1, typename T2>ostream &operator<<(ostream &out, const pair<T1, T2> &p){out << "(" << p.first << ", " << p.second << ")";return out;}
template<class T>void debag(const T &obj){cout<<obj<<endl;}

template< int mod >
struct ModInt {
  int x;

  ModInt() : x(0) {}

  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

  ModInt &operator+=(const ModInt &p) {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &p) {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &p) {
    x = (int) (1LL * x * p.x % mod);
    return *this;
  }

  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }

  ModInt operator-() const { return ModInt(-x); }

  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

  bool operator==(const ModInt &p) const { return x == p.x; }

  bool operator!=(const ModInt &p) const { return x != p.x; }

  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }

  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }

  friend ostream &operator<<(ostream &os, const ModInt &p) {
    return os << p.x;
  }

  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt< mod >(t);
    return (is);
  }

  static int get_mod() { return mod; }
};

using modint = ModInt< mod >;

template <class T>
class fast_fourier_transform {
public:
  using value_type = T;
  using size_type = size_t;
  static constexpr value_type pi = std::acos(value_type(-1.0));

  struct complex {
    value_type re, im;
    constexpr complex(value_type re_ = 0, value_type im_ = 0): re(re_), im(im_) { }
    constexpr complex operator + (const complex &rhs) const { 
      return complex(re + rhs.re, im + rhs.im); 
    }
    constexpr complex operator - (const complex &rhs) const { 
      return complex(re - rhs.re, im - rhs.im); 
    }
    constexpr complex operator * (const complex &rhs) const { 
      return complex(re * rhs.re - im * rhs.im, re * rhs.im + im * rhs.re); 
    }
  };

private:
  size_type M_size;
  std::vector<complex> M_root;

public:
  template <class U>
  std::vector<U> convolve(const std::vector<U> &A, const std::vector<U> &B) {
    size_type res_size = A.size() + B.size() - 1;
    reserve(res_size);
    std::vector<complex> C(M_size), D(M_size);
    for (size_type i = 0; i < A.size(); ++i) {
      C[i].re = static_cast<value_type>(A[i].x);
    }
    for (size_type i = 0; i < B.size(); ++i) {
      D[i].re = static_cast<value_type>(B[i].x);
    }
    discrete_fourier_transform(C);
    discrete_fourier_transform(D);
    for (size_type i = 0; i < M_size; ++i) {
      C[i] = C[i] * D[i];
    }
    inverse_discrete_fourier_transform(C);
    std::vector<U> res(res_size);
    for (size_type i = 0; i < res_size; ++i) {
      res[i] = static_cast<U>(C[i].re / M_size + value_type(0.5));
    }
    return res;
  }

  void reserve(size_type size_) {
    M_size = 1;
    while (M_size < size_) M_size <<= 1;
    M_root.assign(M_size + 1, complex());
    for (size_type i = 0; i <= M_size; ++i) {
      value_type angle = pi * value_type(2.0) / M_size * i;
      M_root[i].re = std::cos(angle);
      M_root[i].im = std::sin(angle);
    }
  }

  void discrete_fourier_transform(std::vector<complex> &F) {
    for (size_type i = 0, j = 1; j + 1 < M_size; ++j) {
      size_type k = M_size >> 1;
      while (k > (i ^= k)) k >>= 1;
      if (i < j) std::swap(F[i], F[j]);
    }
    size_type idx;
    complex first, second;
    for (size_type len = 1, bit = M_size >> 1; len < M_size; len <<= 1, bit >>= 1) {
      for (size_type k = 0; k < M_size; k += (len << 1)) {
        idx = 0;
        for (size_type i = 0; i < len; ++i) {
          first = F[i + k], second = F[(i + k) ^ len];
          F[i + k] = M_root[0] * first + M_root[idx] * second;
          F[(i + k) ^ len] = M_root[0] * first + M_root[idx + (M_size >> 1)] * second;
          idx += bit;
        }
      }
    }
  }

  void inverse_discrete_fourier_transform(std::vector<complex> &F) {
    for (size_type i = 0, j = 1; j + 1 < M_size; ++j) {
      size_type k = M_size >> 1;
      while (k > (i ^= k)) k >>= 1;
      if (i < j) std::swap(F[i], F[j]);
    }
    size_type idx;
    complex first, second;
    for (size_type len = 1, bit = M_size >> 1; len < M_size; len <<= 1, bit >>= 1) {
      for (size_type k = 0; k < M_size; k += (len << 1)) {
        idx = M_size;
        for (size_type i = 0; i < len; ++i) {
          first = F[i + k], second = F[(i + k) ^ len];
          F[i + k] = M_root[0] * first + M_root[idx] * second;
          F[(i + k) ^ len] = M_root[0] * first + M_root[idx - (M_size >> 1)] * second;
          idx -= bit;
        }
      }
    }
  }

};

bool solve(){
  ll n;cin>>n;
  ll K;cin>>K;
  fast_fourier_transform<long double>fft;

  auto f=[&](vector<modint>a,vector<modint>b){
    auto v=fft.convolve<modint>(a,b);
    return vector<modint>(v.begin(),v.begin()+K+1);
  };

  vector<modint>ans(K+1,0);
  ll _a;cin>>_a;
  rep(i,_a+1)ans[i]=1;
  // cout<<ans<<endl;
  rep(i,n-1){
    vector<modint>v(K+1,0);
    ll a;cin>>a;
    rep(i,a+1)v[i]=1;
    // cout<<"v:"<<v<<endl;
    ans=f(ans,v);
    // cout<<"ans:"<<ans<<endl;
  }
  cout<<ans[K]<<endl;

  return false;
}

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout<<fixed<<setprecision(30);
  solve();
}
