#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
ll add_mod(ll a, ll b) { return (((a + b) % MOD) + MOD) % MOD; }
ll multiply_mod(ll a, ll b) { return (((a * b) % MOD) + MOD) % MOD; }
ll pow(ll x, ll n, int m) {
  if (n == 0) return 1;
  ll a = pow(x, n / 2, m);
  a = a * a % m;
  if (n % 2 == 1) a = a * x % m;
  return a;
}
ll divide_mod(ll a, ll b) { return multiply_mod(a, pow(b, MOD - 2, MOD)); }
const int MAXN = 1010;
int c[MAXN];
ll factorial[MAXN];
void compute_factorial() {
  factorial[0] = 1;
  for (int i = 1; i < MAXN; i++) {
    factorial[i] = multiply_mod(i, factorial[i - 1]);
  }
}
int main() {
  ll k;
  cin >> k;
  for (int i = 1; i <= k; i++) {
    cin >> c[i];
    c[i]--;
  }
  ll res = 1;
  int num_before = 0;
  for (int i = 1; i <= k; i++) {
    for (int j = 0; j < c[i]; j++) {
      res = multiply_mod(res, num_before + 1);
      num_before++;
    }
    num_before++;
  }
  compute_factorial();
  for (int i = 1; i <= k; i++) {
    res = divide_mod(res, factorial[c[i]]);
  }
  cout << res << '\n';
  return 0;
}
