#include <bits/stdc++.h>
const int N = 1010, M = 1e9 + 7;
int a[N], c[N][N];
int n;
int main() {
  c[0][0] = 1;
  for (int i = 1; i < N; i++) {
    c[i][0] = 1;
    for (int j = 1; j < N; j++) c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % M;
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int sum = a[0];
  int s = 1;
  for (int i = 1; i < n; i++) {
    sum += a[i];
    s = (1LL * s * c[sum - 1][a[i] - 1]) % M;
  }
  printf("%d\n", s);
  return 0;
}
