#include <bits/stdc++.h>
using namespace std;
int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
int dx4[] = {1, 0, -1, 0};
int dy4[] = {0, 1, 0, -1};
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  cerr << name << " : " << arg1 << "\n";
  ;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
  const char *comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
template <class A, class B>
ostream &operator<<(ostream &out, const pair<A, B> &a) {
  return out << "(" << a.first << "," << a.second << ")";
}
template <class A>
ostream &operator<<(ostream &out, const vector<A> &a) {
  for (const A &it : a) out << it << " ";
  return out;
}
template <class A, class B>
istream &operator>>(istream &in, pair<A, B> &a) {
  return in >> a.first >> a.second;
}
template <class A>
istream &operator>>(istream &in, vector<A> &a) {
  for (A &i : a) in >> i;
  return in;
}
template <typename T, typename T1>
T amax(T &a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T amin(T &a, T1 b) {
  if (b < a) a = b;
  return a;
}
const long long NC = 400005;
long long inv[NC], fac_inv[NC], fac[NC];
void initialize() {
  long long i;
  inv[1] = 1;
  for (i = 2; i <= NC - 2; i++)
    inv[i] = (1000000007 - 1000000007 / i) * inv[1000000007 % i] % 1000000007;
  fac[0] = fac[1] = 1;
  for (i = 2; i <= NC - 2; i++) fac[i] = i * fac[i - 1] % 1000000007;
  fac_inv[0] = fac_inv[1] = 1;
  for (i = 2; i <= NC - 2; i++)
    fac_inv[i] = inv[i] * fac_inv[i - 1] % 1000000007;
}
long long ncr(long long n, long long r) {
  if (n < r) return 0;
  return (fac[n] * fac_inv[r] % 1000000007) * fac_inv[n - r] % 1000000007;
}
void solve() {
  long long k;
  cin >> k;
  vector<long long> v(k);
  for (int i = 0; i < k; i++) {
    cin >> v[i];
  }
  long long i = k - 1;
  long long rem = accumulate((v).begin(), (v).end(), 0);
  long long res = 1;
  while (i >= 0) {
    rem--;
    long long cur = v[i] - 1;
    (res *= ncr(rem, cur)) %= 1000000007;
    rem -= cur;
    i--;
  }
  cout << res << "\n";
  ;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  initialize();
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
