#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 7;
const int M = 4e5;
const int lim = 1e3;
const int p = 1e9 + 7;
const int inf = 0x3f3f3f3f;
long long inv[N], fac[N], a[N];
void init() {
  fac[0] = inv[0] = inv[1] = 1;
  for (long long i = 1; i <= lim; i++) fac[i] = fac[i - 1] * i % p;
  for (long long i = 2; i <= lim; i++) inv[i] = (p - p / i) * inv[p % i] % p;
  for (long long i = 1; i <= lim; i++) inv[i] = inv[i - 1] * inv[i] % p;
}
long long C(int n, int m) { return fac[n] * inv[m] % p * inv[n - m] % p; }
int main() {
  init();
  int n, sum = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    sum += a[i];
  }
  long long ans = 1;
  for (int i = n - 1; i >= 0; i--) {
    ans = (ans * C(sum - 1, a[i] - 1)) % p;
    sum -= a[i];
  }
  printf("%lld\n", ans);
  return 0;
}
