#include <bits/stdc++.h>
using namespace std;
long long int fact[1010], invfact[1010];
long long int powmod(long long int base, long long int expo) {
  if (expo == 0)
    return 1;
  else if (expo & 1)
    return base * powmod(base, expo - 1) % 1000000007;
  else {
    long long int root = powmod(base, expo >> 1);
    return (root * root) % 1000000007;
  }
}
long long int inverse(long long int x) { return powmod(x, 1000000007 - 2); }
void init(long long int n) {
  long long int i;
  fact[0] = 1;
  for (i = 1; i <= n; i++) fact[i] = (i * fact[i - 1]) % 1000000007;
  invfact[n] = inverse(fact[n]);
  for (i = n; i > 0; i--) invfact[i - 1] = (i * invfact[i]) % 1000000007;
}
long long int nCr(long long int n, long long int r) {
  if (r > n || r < 0) return 0;
  return ((fact[n] * invfact[r] % 1000000007) * invfact[n - r]) % 1000000007;
}
int main() {
  long long int n, k, i, sum = 0;
  init(1005);
  cin >> k;
  long long int ans = 1;
  long long int p;
  long long int arr[1005];
  for (i = 0; i < k; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  for (i = k - 1; i >= 0; i--) {
    p = arr[i] - 1;
    ans = (ans * nCr(sum - 1, p)) % 1000000007;
    sum -= arr[i];
  }
  cout << ans;
  return 0;
}
