#include <bits/stdc++.h>
using namespace std;
long long int dp[1005][1005];
long long int fact[100005], ifact[100005];
long long int power(long long int a, long long int b) {
  long long int ans = 1, temp = a;
  while (b > 0) {
    if (b % 2 == 0) {
      temp = (temp * temp) % 1000000007;
      b /= 2;
    } else {
      ans = (ans * temp) % 1000000007;
      b--;
    }
  }
  return ans % 1000000007;
}
void precompute() {
  long long int i = 1;
  fact[0] = fact[1] = 1;
  for (i = 2; i <= 100000; i++)
    fact[i] = (long long int)(i * fact[i - 1]) % 1000000007;
  ifact[100000] = power(fact[100000], 1000000007 - 2);
  for (i = 99999; i >= 0; i--)
    ifact[i] =
        (long long int)(ifact[i + 1] * (i + (long long int)1)) % 1000000007;
}
long long int cal(long long int n, long long int r) {
  long long int ans;
  if (n < r) return 0;
  ans = (fact[n] % 1000000007 * ifact[r] % 1000000007) % 1000000007;
  ans = (ans * ifact[n - r]) % 1000000007;
  return ans % 1000000007;
}
int main() {
  long long int t, i, j, n, m, ans, sum, col[1005], pos, ball, k, cnt;
  cin >> k;
  precompute();
  memset(dp, 0, sizeof(dp));
  sum = 0;
  for (i = 1; i <= k; i++) {
    cin >> col[i];
    sum += col[i];
  }
  cnt = 0;
  for (i = 1; i <= k; i++) {
    for (j = 1; j <= sum; j++) {
      pos = j - 1 - cnt;
      ball = col[i] - 1;
      if (i > 1)
        dp[i][j] = (cal(pos, ball) * dp[i - 1][j - 1]) % 1000000007;
      else
        dp[i][j] = (cal(pos, ball)) % 1000000007;
      dp[i][j] = (dp[i][j] + dp[i][j - 1]) % 1000000007;
    }
    cnt += col[i];
  }
  cout << dp[k][sum];
  return 0;
}
