#include <bits/stdc++.h>
using namespace std;
int k, n, c[1001];
long long gt[1001], igt[1001], kq = 1;
long long moe(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2 == 0) return moe((a * a) % 1000000007, b / 2);
  return (a * moe((a * a) % 1000000007, b / 2)) % 1000000007;
}
void init() {
  gt[0] = 1;
  for (int i = 1; i <= 1000; ++i) gt[i] = (gt[i - 1] * i) % 1000000007;
  igt[1000] = moe(gt[1000], 1000000007 - 2);
  for (int i = 999; i >= 0; --i) {
    igt[i] = (igt[i + 1] * (i + 1)) % 1000000007;
  }
}
void nhap() {
  scanf("%d", &k);
  for (int i = 1; i <= k; ++i) {
    scanf("%d", &c[i]);
  }
}
long long nCk(int a, int b) {
  return ((gt[a] * igt[b]) % 1000000007 * igt[a - b]) % 1000000007;
}
void process() {
  n = c[1];
  for (int i = 2; i <= k; ++i) {
    kq = (kq * nCk(n + c[i] - 1, c[i] - 1)) % 1000000007;
    n += c[i];
  }
  cout << kq;
}
int main() {
  init();
  nhap();
  process();
  return 0;
}
