#include <bits/stdc++.h>
int combi[1000 + 1][1000 + 1] = {1};
void pTriangle(void) {
  int n, r;
  for (n = 0; n < 1000; n++)
    for (r = 0; r <= n; r++) {
      combi[n + 1][r] += combi[n][r];
      combi[n + 1][r] %= 1000000007;
      combi[n + 1][r + 1] += combi[n][r];
      combi[n + 1][r + 1] %= 1000000007;
    }
}
int main(void) {
  int i;
  int k, c[1000];
  int sum;
  long long dp[1000];
  pTriangle();
  scanf("%d", &k);
  for (i = 0; i < k; i++) scanf("%d", c + i);
  sum = c[0];
  dp[0] = 1;
  for (i = 1; i < k; i++) {
    sum += c[i];
    dp[i] = dp[i - 1] * combi[sum - 1][c[i] - 1] % 1000000007;
  }
  printf("%lld\n", dp[k - 1]);
  return 0;
}
