#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7, MAXN = 1002;
int C[MAXN][MAXN], A[MAXN];
int main() {
  for (int i = 0; i < MAXN; i++)
    for (int l = 0; l < MAXN; l++) {
      if (!i || !l || i == l)
        C[i][l] = 1;
      else
        C[i][l] = (C[i - 1][l] + C[i - 1][l - 1]) % MOD;
    }
  int n, sum = 0, tot;
  long long ans = 1;
  scanf("%d", &n), tot = n;
  for (int i = 0; i < n; i++) scanf("%d", &A[i]), sum += A[i];
  for (int i = n - 1; i >= 0; i--) {
    ans = (ans * C[sum - 1][A[i] - 1]) % MOD;
    sum -= A[i];
  }
  printf("%I64d\n", ans);
}
