#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1001;
const long long mod = 1000000007;
int cnt[MAXN];
int sum[MAXN];
long long fact[MAXN];
long long nfact[MAXN];
long long binpow(long long a, long long n) {
  if (n == 0) return 1;
  long long res = binpow(a, n / 2);
  res = (res * res) % mod;
  if (n % 2 == 1) return res = (res * a) % mod;
  return res;
}
long long c(int a, int b) {
  return (fact[b] * ((nfact[a] * nfact[b - a]) % mod)) % mod;
}
void solve() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> cnt[i];
    sum[i] = sum[i - 1] + cnt[i];
  }
  fact[0] = nfact[0] = 1;
  for (int i = 1; i <= sum[n]; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
    nfact[i] = binpow(fact[i], mod - 2);
  }
  long long num = 1;
  for (int i = n; i >= 1; i--) {
    num = (num * c(cnt[i] - 1, sum[i] - 1)) % mod;
  }
  cout << num;
}
int main() {
  if (0) freopen("input.txt", "rt", stdin);
  if (0) freopen("output.txt", "wt", stdout);
  solve();
}
