#include <bits/stdc++.h>
using namespace std;
long long fact[1001];
pair<long long, long long> add_pair(pair<long long, long long> a,
                                    pair<long long, long long> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  return a.first < b.first;
}
long long power(long long a, long long b) {
  long long res = 1;
  a = a % 1000000007;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
      b--;
    }
    a = (a * a) % 1000000007;
    b = b >> 1;
  }
  return res;
}
long long fermat_inv(long long y) { return power(y, 1000000007 - 2); }
void factorial() {
  long long i;
  fact[0] = 1;
  fact[1] = 1;
  for (i = 2; i < 1001; i += 1) fact[i] = (i * fact[i - 1]) % 1000000007;
}
long long bin(long long n, long long r) {
  return (((fact[n] * fermat_inv(fact[n - r])) % 1000000007) *
          fermat_inv(fact[r])) %
         1000000007;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long k, i;
  cin >> k;
  long long c[k], pr[k + 1], dp[k + 1];
  factorial();
  for (i = 0; i < k; i += 1) cin >> c[i];
  for (i = 0; i < k; i += 1) pr[i + 1] = c[i];
  pr[0] = 0;
  for (i = 0; i < k; i += 1) pr[i + 1] += pr[i];
  dp[0] = 0;
  dp[1] = 1;
  for (i = 2; i < k + 1; i += 1) {
    dp[i] = (dp[i - 1] * bin(pr[i] - 1, c[i - 1] - 1)) % 1000000007;
  }
  cout << dp[k] << '\n';
  return 0;
}
