#include <bits/stdc++.h>
using namespace std;
struct T {
  int a;
};
long long int bigmod(long long int a, long long int b, long long int mod) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    long long int hh = bigmod(a, b / 2, mod);
    return (hh * hh) % mod;
  } else {
    return (a * bigmod(a, b - 1, mod)) % mod;
  }
}
long long int ar[1000005], fact[1000005], ifac[1000005];
int main() {
  long long int i, j, k, l, t, cs = 1, r = 1, s, m, n, a, b, c, d, e, f, g, h,
                               u, v, mod = 1000000007;
  fact[0] = 1;
  ifac[0] = bigmod(fact[0], mod - 2, mod);
  for (i = 1; i <= 1000001; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
    ifac[i] = bigmod(fact[i], mod - 2, mod);
  }
  scanf("%I64d", &n);
  long long int ans = 1;
  s = 0;
  for (i = 0; i < n; i++) {
    scanf("%I64d", &ar[i]);
    s = s + ar[i];
    if (i > 0) {
      u = (ifac[ar[i] - 1] * ifac[s - 1 - ar[i] + 1]) % mod;
      u = (fact[s - 1] * u) % mod;
      ans = (ans * u) % mod;
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
