#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const double EPS = 1e-9;
const long long MOD = 1e9 + 7;
const int MAXN = 1005;
int A[MAXN];
int B[MAXN];
int k, n;
long long fact[MAXN * MAXN];
long long inv[MAXN * MAXN];
long long bigmod(long long a, long long b) {
  if (b == 0) return 1;
  a %= MOD;
  if (b == 1) return a;
  long long res = bigmod(a, b / 2);
  res = (res * res) % MOD;
  if (b % 2) res = (res * a) % MOD;
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long now = 1;
  int last = MAXN * MAXN - 1;
  fact[0] = now;
  inv[0] = bigmod(now, MOD - 2);
  for (int i = 1; i <= last; i++) {
    now = (now * i) % MOD;
    fact[i] = now;
    inv[i] = bigmod(now, MOD - 2);
  }
  long long sek = 0;
  long long res = 1;
  cin >> k;
  for (int i = 0; i < k; i++) {
    cin >> A[i];
    long long x = sek + 1, y = A[i] - 1;
    if (y != 0) {
      long long jum = fact[y + x - 1];
      jum = (jum * inv[y]) % MOD;
      jum = (jum * inv[x - 1]) % MOD;
      if (jum == 0) jum = 1;
      res = (res * jum) % MOD;
    }
    sek += A[i];
  }
  cout << res << '\n';
}
