#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool chmax(T& a, const T& b) {
  return a < b ? (a = b, true) : false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  return b < a ? (a = b, true) : false;
}
long long N, K;
long long fact[2001];
const long long MOD = 1e9 + 7;
long long mod_pow(long long x, long long y = MOD - 2) {
  long long res = 1;
  while (y) {
    if (y & 1) (res *= x) %= MOD;
    (x *= x) %= MOD;
    y >>= 1;
  }
  return res;
}
int main() {
  scanf("%lld", &K);
  vector<long long> C(K);
  for (int i = (int)(0); i < (int)(K); i++) {
    scanf("%lld", &C[i]);
  }
  N = accumulate(C.begin(), C.end(), 0ll);
  fact[0] = 1;
  for (long long i = 1; i <= 2000; i++) {
    fact[i] = fact[i - 1] * i % MOD;
  }
  long long ans = 1, sum = 0;
  for (int i = (int)(0); i < (int)(K); i++) {
    (ans *= fact[sum + C[i] - 1]) %= MOD;
    (ans *= mod_pow(fact[sum])) %= MOD;
    (ans *= mod_pow(fact[C[i] - 1])) %= MOD;
    sum += C[i];
  }
  printf("%lld\n", ans);
  return 0;
}
