#include <bits/stdc++.h>
using namespace std;
vector<long long> factorial(1000001);
void cal() {
  factorial[0] = 1;
  for (long long i = 1; i <= 1e6; i++)
    factorial[i] = (factorial[i - 1] * i) % 1000000007;
  return;
}
long long power(long long a, long long n, long long m) {
  if (n == 0) return 1;
  long long p = power(a, n / 2, m) % m;
  p = (p * p) % m;
  if (n & 1) p = (p * a) % m;
  return p;
}
long long comb(long long n, long long r) {
  if (r == 0 or n == r) return 1;
  long long ans = factorial[n];
  ans =
      (ans * power(factorial[n - r], 1000000007 - 2, 1000000007)) % 1000000007;
  ans = (ans * power(factorial[r], 1000000007 - 2, 1000000007)) % 1000000007;
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  t = 1;
  cal();
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    for (long long i = 0; i <= n - 1; i++) cin >> a[i];
    long long ans = 1, total = 0;
    for (long long i = 0; i <= n - 1; i++) {
      ans = (ans * (comb(total + a[i] - 1, a[i] - 1))) % 1000000007;
      total += a[i];
    }
    cout << ans;
  }
  return 0;
}
