#include <bits/stdc++.h>
using namespace std;
const int N = 1234567;
long long dp[1005], A[1005], fact[1005], inv[1005];
long long fast_pow(long long n, long long p) {
  if (p == 0) return 1;
  if (p == 1) return n;
  long long b = fast_pow(n, p / 2);
  if (p % 2) return (((b * b) % 1000000007) * n) % 1000000007;
  return (b * b) % 1000000007;
}
void factorial() {
  fact[0] = 1;
  for (int i = 1; i <= 1000; i++) {
    fact[i] = fact[i - 1] * i % 1000000007;
  }
}
void mmi() {
  for (int i = 0; i <= 1000; i++) inv[i] = fast_pow(fact[i], 1000000007 - 2);
}
long long nCr(long long n, long long r) {
  if (r > n) return 0;
  if (r == 0) return 1;
  return fact[n] * (inv[n - r] * inv[r] % 1000000007) % 1000000007;
}
int main() {
  factorial();
  mmi();
  int k;
  cin >> k;
  for (int i = 1; i <= k; i++) cin >> A[i];
  long long sum = 0;
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 1; i <= k; i++) {
    dp[i] = dp[i - 1] * nCr(sum + A[i] - 1, A[i] - 1) % 1000000007;
    sum += A[i];
  }
  if (dp[k] < 0) dp[k] += 1000000007;
  cout << dp[k];
  return 0;
}
