#include <bits/stdc++.h>
using namespace std;
long long ans = 1;
long long exp(long long taban, long long us, long long md) {
  long long carpan = taban % md;
  if (carpan == 0) return 0;
  long long temp = us;
  long long res = 1;
  while (temp) {
    if (temp % 2) res = (res * carpan) % md;
    temp /= 2;
    carpan = (carpan * carpan) % md;
  }
  return res;
}
vector<long long> fact;
vector<long long> inv_fact;
void fact_init(int n) {
  fact.resize(n + 5);
  inv_fact.resize(n + 5);
  fact[0] = inv_fact[0] = 1;
  for (int i = 1; i <= n; i++) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
    inv_fact[i] = exp(fact[i], 1000000007 - 2, 1000000007);
  }
}
long long komb(long long a, long long b) {
  if (a < b) return 0;
  return fact[a] * (inv_fact[a - b] * inv_fact[b] % 1000000007) % 1000000007;
}
int main() {
  fact_init(1005);
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int sum = arr[0];
  for (int i = 1; i < n; i++) {
    sum += arr[i];
    ans *= komb((sum - 1), arr[i] - 1);
    ans = ans % 1000000007;
  }
  cout << ans;
  return 0;
}
