#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e17;
const long long MB = 20;
const long long MOD = 1e9 + 7;
const long long maxN = 2e3;
long long fact[maxN], rev[maxN];
long long mod_pow(long long a, long long b) {
  if (!b) return 1;
  if (b % 2) return a * mod_pow(a, b - 1) % MOD;
  long long q = mod_pow(a, b / 2);
  return q * q % MOD;
}
long long C(long long n, long long k) {
  if (n < k) return 0;
  return (fact[n] * rev[k]) % MOD * rev[n - k] % MOD;
}
void solve() {
  long long k;
  cin >> k;
  long long n = 0;
  vector<long long> c(k + 1);
  for (long long i = 1; i <= k; ++i) {
    cin >> c[i];
    n += c[i];
  }
  fact[0] = 1;
  for (long long i = 1; i < maxN; i++) fact[i] = fact[i - 1] * i % MOD;
  for (long long i = 0; i < maxN; i++) rev[i] = mod_pow(fact[i], MOD - 2);
  vector<vector<long long>> dp(k + 1, vector<long long>(n + 1));
  dp[0][0] = 1;
  long long pref = 0;
  for (long long i = 1; i <= k; i++) {
    long long pls = 0;
    for (long long j = 0; j <= n; j++) {
      dp[i][j] = (dp[i][j] + pls * C(j - pref - 1, c[i] - 1) % MOD) % MOD;
      pls = (pls + dp[i - 1][j]) % MOD;
    }
    pref += c[i];
  }
  cout << dp[k][n];
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed;
  cout.precision(12);
  long long t = 1;
  while (t--) solve();
}
