#include <bits/stdc++.h>
const int N = 2000;
const long long MOD = 1e9 + 7;
long long C[N][N];
int num[N];
int main() {
  C[0][0] = 1;
  for (int i = 1; i < N; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
      while (C[i][j] >= MOD) {
        C[i][j] -= MOD;
      }
    }
  }
  int k;
  scanf("%d", &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &num[i]);
  }
  long long ans = 1;
  long long cnt = num[1];
  for (int i = 2; i <= k; i++) {
    ans = (ans * C[cnt + num[i] - 1][num[i] - 1]) % MOD;
    cnt += num[i];
  }
  printf("%lld\n", ans);
  return 0;
}
