#include <bits/stdc++.h>
long long int cache[1001][1001] = {
    0,
};
long long int combi(int n1, int n2) {
  if (cache[n1][n2]) return cache[n1][n2];
  if (n1 == n2 || n2 == 0) return cache[n1][n2] = 1;
  return cache[n1][n2] =
             (combi(n1 - 1, n2 - 1) + combi(n1 - 1, n2)) % 1000000007;
}
int main() {
  int n, sum = 0;
  long long int temp = 1;
  cache[1][1] = 1;
  int cnt[1003];
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &cnt[i]);
  for (int i = 1; i <= n; i++) {
    sum += cnt[i];
    temp = (combi(sum - 1, cnt[i] - 1) * temp) % 1000000007;
  }
  printf("%lld", temp);
}
