#include <bits/stdc++.h>
using namespace std;
inline long long int fast_input(void) {
  char t;
  long long int x = 0;
  long long int neg = 0;
  t = getchar();
  while ((t < 48 || t > 57) && t != '-') t = getchar();
  if (t == '-') {
    neg = 1;
    t = getchar();
  }
  while (t >= 48 && t <= 57) {
    x = (x << 3) + (x << 1) + t - 48;
    t = getchar();
  }
  if (neg) x = -x;
  return x;
}
inline void fast_output(long long int x) {
  char a[20];
  long long int i = 0, j;
  a[0] = '0';
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x == 0) putchar('0');
  while (x) {
    a[i++] = x % 10 + 48;
    x /= 10;
  }
  for (j = i - 1; j >= 0; j--) {
    putchar(a[j]);
  }
  putchar('\n');
}
long long int power(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b % 2) ans = ans * a;
    b /= 2;
    a *= a;
    if (a > 1000000007) a %= 1000000007;
    if (ans > 1000000007) ans %= 1000000007;
  }
  return ans;
}
long long int k, c[1001], i, ans, fac[1000005], invfac[1000005], sum, bot;
int main() {
  k = fast_input();
  fac[0] = 1, invfac[0] = 1;
  sum = 0;
  for (i = 0; i < k; i++) {
    c[i] = fast_input();
    sum += c[i];
  }
  for (i = 1; i <= sum; i++) {
    fac[i] = fac[i - 1] * i;
    if (fac[i] > 1000000007) fac[i] %= 1000000007;
    invfac[i] = invfac[i - 1] * power(i, 1000000007 - 2);
    if (invfac[i] > 1000000007) invfac[i] %= 1000000007;
  }
  ans = fac[sum];
  ans *= invfac[c[0]];
  ans %= 1000000007;
  bot = c[0];
  for (i = 1; i < k; i++) {
    ans = ans * invfac[c[i]];
    if (ans > 1000000007) ans %= 1000000007;
    bot += c[i];
    ans *= c[i];
    if (ans > 1000000007) ans %= 1000000007;
    ans = ans * invfac[bot];
    if (ans > 1000000007) ans %= 1000000007;
    ans = ans * fac[bot - 1];
    if (ans > 1000000007) ans %= 1000000007;
  }
  fast_output(ans);
  return 0;
}
