#include <bits/stdc++.h>
long long ans(int len, int c);
long long comb[1000][1000] = {0};
int main(void) {
  int k, c[1000], i;
  long long dp[1000] = {1};
  for (i = 0; i <= 1000; i++) {
    comb[i][0] = comb[i][i] = 1;
  }
  scanf("%i", &k);
  for (i = 0; i < k; i++) scanf("%i", &c[i]);
  int len = c[0] - 1;
  for (i = 1; i < k; i++) {
    len += c[i];
    dp[i] = (dp[i - 1] * ans(len, c[i] - 1)) % 1000000007;
  }
  printf("%I64d\n", dp[k - 1]);
  return 0;
}
long long ans(int len, int c) {
  if (!comb[len][c])
    comb[len][c] = (ans(len - 1, c) + ans(len - 1, c - 1)) % 1000000007;
  return comb[len][c];
}
