#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 5;
const int MOD = 1e9 + 7;
const int INF = 2e9;
int arr[MAXN];
long long C[MAXN][MAXN];
void precalc() {
  C[1][1] = 1;
  for (int i = 2; i <= 1000; i++)
    for (int j = 1; j <= i; j++)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % MOD;
}
long long bin_mult(long long A, long long B, long long md) {
  long long RES = 0;
  while (B) {
    if (B & 1) RES = (RES + A) % md;
    A = (A + A) % md;
    B >>= 1;
  }
  return RES;
}
int main() {
  precalc();
  int N = 0;
  long long RES = 1;
  scanf("%i", &N);
  for (int i = 1; i <= N; i++) scanf("%i", &arr[i]);
  long long prevI = arr[1];
  for (int i = 2; i <= N; i++) {
    RES = bin_mult(RES, C[arr[i] + prevI][arr[i]], MOD);
    prevI += arr[i];
  }
  printf("%I64d", RES);
  return 0;
}
