#include <bits/stdc++.h>
using namespace std;
const int mod = 1000 * 1000 * 1000 + 7;
const int N = 2 * 1000 * 1000 + 5;
int fact[N], ifact[N];
int power(int a, int n) {
  int result = 1;
  while (n > 0) {
    if (n % 2) {
      result = (1LL * result * a) % mod;
    }
    a = (1LL * a * a) % mod;
    n /= 2;
  }
  return result;
}
void prepare() {
  fact[0] = ifact[0] = 1;
  for (int i = (1); i <= (N - 1); ++i) {
    fact[i] = (1LL * i * fact[i - 1]) % mod;
    ifact[i] = power(fact[i], mod - 2);
  }
}
int newton(int n, int k) {
  if (n < k || k < 0) return 0;
  int result = fact[n];
  result = (1LL * result * ifact[n - k]) % mod;
  result = (1LL * result * ifact[k]) % mod;
  return result;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  prepare();
  int n;
  cin >> n;
  int total = 0;
  int result = 1;
  for (int i = 0; i < (n); ++i) {
    int x;
    cin >> x;
    total += x;
    result = (1LL * result * newton(total - 1, x - 1)) % mod;
  }
  cout << result << '\n';
  return 0;
}
