#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_temp>
using smaller_queue = priority_queue<Q_temp, vector<Q_temp>, greater<Q_temp>>;

const ll MOD = (ll)(1e9 + 7);
const int INF = (int)1e9;
const ll LINF = (ll)4e18;
const double PI = acos(-1.0);

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define possible(n) cout << ((n) ? "possible" : "impossible") << endl
#define Yay(n) cout << ((n) ? "Yay!" : ":(") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << endl;

vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

template <typename T>
struct Polynomial
{
  using P = Polynomial;
  vector<T> co;
  Polynomial() : co(1, T(1)) {}
  Polynomial(int sz) : co(sz, 0) {}
  Polynomial(vector<T> co) : co(co) {}

  size_t size() const
  {
    return co.size();
  };

  void shrink()
  {
    while (co.size() > 1u && !co.back())
      co.pop_back();
  }

  void reduce()
  {
    T g = abs(co.back());
    if (!g)
      return;
    for (T c : co)
      if (c != 0)
        g = __gcd(g, abs(c));
    if (co.back() < 0)
      g *= -1;
    for (T &c : co)
      c /= g;
  }

  void print()
  {
    shrink();
    reduce();
    int n = size(), flg = 0;
    for (int i = n - 1; i > 0; i--)
    {
      if (!co[i])
        continue;
      flg = 1;
      if (i != n - 1 && co[i] > 0)
        cout << "+";
      if (co[i] == -1)
        cout << "-";
      else if (co[i] != 1)
        cout << co[i];

      cout << "x";
      if (i != 1)
        cout << "^" << i;
    }
    if (co[0])
    {
      if (flg && co[0] > 0)
        cout << "+";
      cout << co[0];
    }
    cout << endl;
  }

  T operator[](int i) const
  {
    return co[i];
  }

  T &operator[](int i)
  {
    return co[i];
  }

  P operator-() const
  {
    P res = *this;
    for (T &c : res.co)
      c *= -1;
    return res;
  }

  P operator+(const P &a) const
  {
    int n = size(), m = a.size();
    P res(max(n, m));
    for (int i = 0; i < n; i++)
      res[i] += co[i];
    for (int i = 0; i < m; i++)
      res[i] += a[i];
    return res;
  }

  P operator-(const P &a) const { return *this + (-a); };

  P operator*(const P &a) const
  {
    int n = size(), m = a.size();
    P res(n + m);
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        res[i + j] += co[i] * a[j];
    res.shrink();
    return res;
  }

  P pow(const P &a, int k) const
  {
    P res;
    for (int i = 0; i < k; i++)
      res = res * a;
    return res;
  }

  pair<P, P> divide(const P &a) const
  {
    int n = size(), m = a.size(), s = n - m + 1;
    if (s < 0)
      return make_pair(P(1), *this);
    P div(s);
    P rest = *this;
    for (int i = 0; i < s; i++)
    {
      if (rest[n - (i + 1)] % a[m - 1] != 0)
        for (T &c : rest.co)
          c *= a[m - 1];
      T d = rest[n - (i + 1)] / a[m - 1];
      div[s - (i + 1)] = d;
      for (int j = m; j > 0; j--)
        rest[n - (i + j)] -= a[m - j] * d;
    }
    return make_pair(div, rest);
  }

  P operator/(const P &a) const { return divide(a).first; };
  P operator%(const P &a) const { return divide(a).second; };
};

template <typename T>
Polynomial<T> gcd(Polynomial<T> a, Polynomial<T> b)
{
  a.shrink();
  a.reduce();
  b.shrink();
  b.reduce();
  if (a.size() < b.size())
    swap(a, b);
  if (b.size() == 1u && !b[0])
    return a;
  return gcd(b, a % b);
}

//----------追加分----------
// f(x) * (1-x^k)
template <typename T>
Polynomial<T> mul1k(Polynomial<T> &a, int k)
{
  Polynomial<T> res(a.size() + k);
  for (int i = 0; i < a.size(); i++)
  {
    res[i] += a[i];
    res[i + k] -= a[i];
  }
  return res;
}
//-------------------------
template <int MOD>
struct Fp
{
  long long val;

  constexpr Fp(long long v = 0) noexcept : val(v % MOD)
  {
    if (val < 0)
      v += MOD;
  }

  constexpr int getmod()
  {
    return MOD;
  }

  constexpr Fp operator-() const noexcept
  {
    return val ? MOD - val : 0;
  }

  constexpr Fp operator+(const Fp &r) const noexcept
  {
    return Fp(*this) += r;
  }

  constexpr Fp operator-(const Fp &r) const noexcept
  {
    return Fp(*this) -= r;
  }

  constexpr Fp operator*(const Fp &r) const noexcept
  {
    return Fp(*this) *= r;
  }

  constexpr Fp operator/(const Fp &r) const noexcept
  {
    return Fp(*this) /= r;
  }

  constexpr Fp operator%(const Fp &r) const noexcept
  {
    return Fp(val % r.val);
  }

  constexpr Fp &operator+=(const Fp &r) noexcept
  {
    val += r.val;
    if (val >= MOD)
      val -= MOD;
    return *this;
  }

  constexpr Fp &operator-=(const Fp &r) noexcept
  {
    val -= r.val;
    if (val < 0)
      val += MOD;
    return *this;
  }

  constexpr Fp &operator*=(const Fp &r) noexcept
  {
    val = val * r.val % MOD;
    return *this;
  }

  constexpr Fp &operator/=(const Fp &r) noexcept
  {
    long long a = r.val, b = MOD, u = 1, v = 0;
    while (b)
    {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    val = val * u % MOD;
    if (val < 0)
      val += MOD;
    return *this;
  }

  constexpr bool operator==(const Fp &r) const noexcept
  {
    return this->val == r.val;
  }

  constexpr bool operator!=(const Fp &r) const noexcept
  {
    return this->val != r.val;
  }

  friend constexpr ostream &operator<<(ostream &os, const Fp<MOD> &x) noexcept
  {
    return os << x.val;
  }

  friend constexpr istream &operator>>(istream &is, Fp<MOD> &x) noexcept
  {
    return is >> x.val;
  }
};

Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept
{
  if (n == 0)
    return 1;
  auto t = modpow(a, n / 2);
  t = t * t;
  if (n & 1)
    t = t * a;
  return t;
}

using mint = Fp<MOD>;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(20) << setiosflags(ios::fixed);
  int n, k;
  cin >> n >> k;
  int a[100];
  rep(i, n) cin >> a[i];
  Polynomial<mint> f;
  rep(i, n) f = mul1k(f, a[i] + 1);
  Polynomial<mint> g;
  rep(i, n) g = mul1k(g, 1);
  //f = f / g;
  //cout << f[k] << endl;
  return 0;
}
