#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int k;
long long a[1111];
map<long long, long long> mp1;
map<long long, long long> mp2;
void C(long long a, long long b) {
  for (long long i = a; i >= a - b + 1; --i) mp1[i]++;
  for (long long i = b; i >= 1; --i) mp2[i]++;
}
long long q_pow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
void exgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return;
  }
  exgcd(b, a % b, x, y);
  long long t = x;
  x = y;
  y = t - a / b * y;
}
int main() {
  long long sum = 0;
  scanf("%d", &k);
  for (int i = 1; i <= k; ++i) {
    scanf("%lld", a + i);
    sum += a[i];
  }
  for (int i = k; i >= 1; --i) {
    C(sum - 1, a[i] - 1);
    sum -= a[i];
  }
  long long ans1 = 1, ans2 = 1;
  for (map<long long, long long>::iterator iter = mp1.begin();
       iter != mp1.end(); ++iter) {
    ans1 = (ans1 * q_pow(iter->first, iter->second)) % mod;
  }
  if (ans1 == 0) ans1 = mod;
  for (map<long long, long long>::iterator iter = mp2.begin();
       iter != mp2.end(); ++iter) {
    ans2 = (ans2 * q_pow(iter->first, iter->second)) % mod;
  }
  if (ans2 == 0) ans2 = mod;
  long long x, y;
  long long t = gcd(ans2, mod);
  long long tmpMod = mod / t;
  ans2 /= t;
  ans1 /= t;
  exgcd(ans2, tmpMod, x, y);
  printf("%lld\n", ((x % mod + mod) % mod * ans1) % mod);
  return 0;
}
