#include <bits/stdc++.h>
using namespace std;
const int N = 10001;
const int P = 1e9 + 7;
inline void add(int& a, int b) {
  a += b;
  if (a >= P) a -= P;
}
inline void mul(int& a, int b) { a = (long long)a * b % P; }
inline int inver(int x) {
  int ret = 1, y = P - 2;
  while (y) {
    if (y & 1) mul(ret, x);
    mul(x, x);
    y >>= 1;
  }
  return ret;
}
int fac[N], inv[N];
void pre() {
  fac[0] = inv[0] = 1;
  for (int i = 1; i < N; ++i) {
    fac[i] = i;
    mul(fac[i], fac[i - 1]);
  }
  inv[N - 1] = inver(fac[N - 1]);
  for (int i = N - 2; i > 0; i--) {
    inv[i] = inv[i + 1];
    mul(inv[i], i + 1);
  }
}
int main() {
  pre();
  int k, x;
  scanf("%d", &k);
  int ans = 1;
  int tot = 0;
  for (int i = 0; i < k; ++i) {
    scanf("%d", &x);
    int tmp = 1;
    mul(tmp, fac[tot + x - 1]);
    mul(tmp, inv[tot]);
    mul(tmp, inv[x - 1]);
    mul(ans, tmp);
    add(tot, x);
  }
  printf("%d\n", ans);
  return 0;
}
