#include <bits/stdc++.h>
using namespace std;
int k, c, fact[10010], refact[10010];
int POW(int a, int b) {
  int res;
  for (res = 1; b; (b & 1) && (res = 1LL * res * a % 1000000007),
      a = 1LL * a * a % 1000000007, b >>= 1)
    ;
  return res;
}
int C(int n, int m) {
  if (m > n) return 0;
  return 1LL * fact[n] * refact[m] % 1000000007 * refact[n - m] % 1000000007;
}
void Init() {
  fact[0] = refact[0] = 1;
  for (int i = 1; i <= 1010; ++i) {
    fact[i] = 1LL * fact[i - 1] * i % 1000000007;
    refact[i] = POW(fact[i], 1000000007 - 2);
  }
}
void Work() {
  int i, cnt, ans = 1;
  scanf("%d%d", &k, &cnt);
  for (i = 2; i <= k; ++i) {
    scanf("%d", &c);
    ans = 1LL * ans * C(cnt + c - 1, cnt) % 1000000007;
    cnt += c;
  }
  printf("%d\n", ans);
}
int main() {
  Init();
  Work();
  return 0;
}
