#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
const long long MOD = 1000000007;
long long C[MAXN][MAXN];
int a[MAXN];
void db() {
  C[0][0] = 1;
  C[1][0] = 1;
  C[1][1] = 1;
  for (int i = 2; i < MAXN; i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; j++) {
      C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
      C[i][j] %= MOD;
    }
  }
}
int main() {
  int k;
  db();
  while (~scanf("%d", &k)) {
    long long sum = 0;
    for (int i = 1; i <= k; i++) {
      scanf("%d", a + i);
      sum += a[i];
    }
    long long ans = 1;
    for (int i = k; i >= 1; i--) {
      ans *= C[sum - 1][a[i] - 1];
      ans %= MOD;
      sum -= a[i];
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
