#include <bits/stdc++.h>
using namespace std;
long long int fast_pow(long long int b, long long int e) {
  long long int res = 1;
  while (e > 0) {
    if (e & 1) {
      res *= b;
      res %= 1000000007;
    }
    b *= b;
    b %= 1000000007;
    e >>= 1;
  }
  return res;
}
long long int comb(long long int n, long long int k) {
  long long int res = n;
  if (n < k * 2) {
    k = n - k;
  }
  if (k == 0) {
    return 1;
  }
  for (int i = 2; i <= k; i++) {
    res *= (n - i + 1);
    res %= 1000000007;
    res *= fast_pow(i, 1000000007 - 2);
    res %= 1000000007;
  }
  return res;
}
long long int fact[1005];
long long int fact_inv[1005];
int main(void) {
  iostream::sync_with_stdio(0);
  fact[1] = fact[0] = 1;
  for (int i = 2; i < 1005; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= 1000000007;
  }
  fact_inv[1] = fact_inv[0] = 1;
  for (int i = 2; i < 1005; i++) {
    fact_inv[i] = fast_pow(fact[i], 1000000007 - 2);
  }
  int k, n = 0;
  int a[1005];
  cin >> k;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
    n += a[i];
  }
  long long int res = 1;
  int total = 0;
  for (int i = 0; i < k; i++) {
    res *= comb(total + a[i] - 1, a[i] - 1);
    res %= 1000000007;
    total += a[i];
  }
  cout << res << endl;
  return 0;
}
