#include <bits/stdc++.h>
using namespace std;
long long degree(long long a, long long k, long long p) {
  long long res = 1;
  long long cur = a;
  while (k) {
    if (k % 2) {
      res = (res * cur) % p;
    }
    k /= 2;
    cur = (cur * cur) % p;
  }
  return res;
}
long long get_degree(long long n, long long p) {
  long long int degree_num = 0;
  long long u = p;
  long long temp = n;
  while (u <= temp) {
    degree_num += temp / u;
    u *= p;
  }
  return degree_num;
}
long long combinations(long long int n, long long int k, long long p) {
  long long int num_degree = get_degree(n, p) - get_degree(n - k, p);
  long long int den_degree = get_degree(k, p);
  if (num_degree > den_degree) {
    return 0;
  }
  long long res = 1;
  for (long long i = n; i > n - k; --i) {
    long long ti = i;
    while (ti % p == 0) {
      ti /= p;
    }
    res = (res * ti) % p;
  }
  for (long long i = 1; i <= k; ++i) {
    long long ti = i;
    while (ti % p == 0) {
      ti /= p;
    }
    res = (res * degree(ti, p - 2, p)) % p;
  }
  return res;
}
long long int dp[1001] = {0};
long long int c[1001] = {0};
long long int c1[1001] = {0};
int main(void) {
  ios_base::sync_with_stdio(false);
  long long int k;
  cin >> k;
  for (long long int i = 0; i < k; i++) cin >> c[i];
  dp[0] = 1;
  c1[0] = c[0];
  for (long long int i = 1; i < k; i++) c1[i] = c[i] + c1[i - 1];
  for (long long int i = 1; i < k; i++) {
    dp[i] = dp[i - 1];
    long long int obj = c[i] - 1;
    long long int pla = c1[i - 1] + 1;
    long long int comb;
    if (pla > 1)
      comb = combinations(obj + pla - 1, pla - 1, 1000000007ll);
    else
      comb = 1;
    dp[i] = (dp[i - 1] * comb) % 1000000007ll;
  }
  cout << dp[k - 1];
}
