#include <bits/stdc++.h>
using namespace std;
long long fac[1005], MOD = 1000000007, ara[1005], sum[1005];
long long BigMod(long long B, long long P, long long M) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return R;
}
void gen() {
  long long i;
  fac[0] = 1;
  for (i = 1; i <= 1000; i++) fac[i] = (fac[i - 1] * i) % MOD;
}
long long dp[1005];
long long solve(long long n) {
  long long up = sum[n] - 1;
  long long down = ara[n] - 1;
  long long an = up - down;
  up = fac[up];
  down = fac[down];
  an = fac[an];
  long long res = BigMod(down, MOD - 2, MOD);
  up = (up * res) % MOD;
  res = BigMod(an, MOD - 2, MOD);
  up = (up * res) % MOD;
  return up;
}
long long rec(long long n) {
  dp[1] = 1;
  long long i;
  for (i = 2; i <= n; i++) {
    dp[i] = (dp[i - 1] * solve(i)) % MOD;
  }
  return dp[n];
}
int main() {
  gen();
  long long n;
  scanf("%I64d", &n);
  long long i, c;
  for (i = 1; i <= n; i++) {
    scanf("%I64d", &ara[i]);
    sum[i] = sum[i - 1] + ara[i];
  }
  printf("%I64d\n", rec(n));
}
