#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int mod1 = (1 << 23) * 71 + 1;
const int mod2 = (1 << 23) * 77 + 1;
const int gen = 3;
int k, K;
int pw(int a, int b, int mod) {
  int res = 1;
  while (b != 0) {
    if (b % 2 == 1) res = (1LL * res * a) % mod;
    a = (1LL * a * a) % mod;
    b /= 2;
  }
  return res;
}
void ntt(vector<int>& coeff, int mod, bool reverse) {
  int i, j, bit, len, root, w, v, a, b;
  int N = mod - 1;
  int n = coeff.size();
  for (i = 1, j = 0; i < n; i++) {
    for (bit = (n >> 1); j >= bit; bit >>= 1) j -= bit;
    j += bit;
    if (i < j) swap(coeff[i], coeff[j]);
  }
  for (len = 1; len < n; len <<= 1) {
    root = pw(gen, N / (len + len), mod);
    if (reverse) root = pw(root, mod - 2, mod);
    for (i = 0; i < n; i += len + len) {
      w = 1;
      for (j = 0; j < len; j++) {
        a = coeff[i + j];
        b = (1LL * coeff[i + j + len] * w) % mod;
        coeff[i + j] = a + b;
        coeff[i + j + len] = a - b;
        if (coeff[i + j] >= mod) coeff[i + j] -= mod;
        if (coeff[i + j + len] < 0) coeff[i + j + len] += mod;
        w = (1LL * w * root) % mod;
      }
    }
  }
  if (reverse) {
    int inv = pw(n, mod - 2, mod);
    for (i = 0; i < n; i++) coeff[i] = (1LL * coeff[i] * inv) % mod;
  }
}
vector<int> A, B, a1, a2, b1, b2;
void convolute(vector<int>& A, vector<int>& B) {
  int i, n = K;
  for (i = 0; i < n; i++) {
    a1[i] = a2[i] = A[i];
    b1[i] = b2[i] = B[i];
  }
  ntt(a1, mod1, false);
  ntt(b1, mod1, false);
  ntt(a2, mod2, false);
  ntt(b2, mod2, false);
  for (i = 0; i < n; i++) {
    a1[i] = (1LL * a1[i] * b1[i]) % mod1;
    a2[i] = (1LL * a2[i] * b2[i]) % mod2;
  }
  ntt(a1, mod1, true);
  ntt(a2, mod2, true);
  for (int i = 0; i <= k; i++) {
    A[i] =
        (((1LL * pw(mod1, mod2 - 2, mod2) * (a2[i] - a1[i])) % mod2) + mod2) %
        mod2;
    A[i] = (((1LL * A[i] * mod1) % MOD) + a1[i]) % MOD;
  }
}
int main() {
  int q, n, i;
  scanf("%d%d", &q, &k);
  K = (1 << (33 - __builtin_clz(k)));
  A.resize(K);
  B.resize(K);
  a1.resize(K);
  a2.resize(K);
  b1.resize(K);
  b2.resize(K);
  A[0] = 1;
  while (q--) {
    scanf("%d", &n);
    fill(B.begin(), B.end(), 0);
    fill(B.begin(), B.begin() + n + 1, 1);
    convolute(A, B);
  }
  printf("%d\n", A[k]);
  return 0;
}
