#include <bits/stdc++.h>
using namespace std;
const int N = 2500;
const unsigned long long M = 1000000007;
unsigned long long c[N][N];
unsigned long long cal(int n, int m) {
  unsigned long long &cur = c[n][m];
  if (cur) return cur;
  if (n == m || m == 0) return cur = 1;
  return cur = (cal(n - 1, m - 1) + cal(n - 1, m)) % M;
}
int main() {
  int i, j;
  for (i = 0; i < N; i++)
    for (j = 0; j < N; j++) c[i][j] = 0;
  unsigned long long ans, tot;
  int k, ai;
  scanf("%d", &k);
  scanf("%d", &ai);
  ans = 1;
  tot = ai;
  for (i = 1; i < k; i++) {
    scanf("%d", &ai);
    ans = (ans * cal(tot + ai - 1, ai - 1)) % M;
    tot += ai;
  }
  printf("%I64u\n", ans);
  return 0;
}
