#include <bits/stdc++.h>
using namespace std;
int MOD = 1e9 + 7;
long long f[1001];
long long modpow(long long x, long long n, int m) {
  if (n == 0) return 1;
  long long a = modpow(x, n / 2, m);
  a = a * a % m;
  if (n % 2 == 1) a = a * x % m;
  return a;
}
long long inv(long long x) { return modpow(x, MOD - 2, MOD); }
int main() {
  f[0] = 1;
  for (int i = 1; i < 1001; i++) {
    f[i] = (i * f[i - 1]) % MOD;
  }
  int k;
  int total = 0;
  long long ans = 1;
  cin >> k;
  cin >> total;
  for (int i = 0; i < k - 1; i++) {
    int c;
    cin >> c;
    total += c;
    long long comb = (f[total - 1] * inv(f[c - 1])) % MOD;
    comb = (comb * inv(f[total - c])) % MOD;
    ans = (ans * comb) % MOD;
  }
  cout << ans << '\n';
}
