#include <bits/stdc++.h>
using namespace std;
unsigned long long int dp[1001], sum[1001];
unsigned long long int nCrModp(unsigned long long int n,
                               unsigned long long int r) {
  unsigned long long int p = 1000000007;
  n = n + r - 1;
  r = r - 1;
  unsigned long long int C[r + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (unsigned long long int i = 1; i <= n; i++) {
    for (unsigned long long int j = min(i, r); j > 0; j--)
      C[j] = (C[j] + C[j - 1]) % p;
  }
  return C[r];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  unsigned long long int n, t, i, j, k, ans = 0;
  cin >> n;
  unsigned long long int ar[n];
  for (i = 0; i < n; i++) {
    cin >> ar[i];
    if (i != 0)
      sum[i] = sum[i - 1] + ar[i];
    else
      sum[i] = ar[i];
  }
  unsigned long long int prod = 1;
  dp[0] = 1;
  for (i = 1; i < n; i++) {
    dp[i] = nCrModp(sum[i - 1], ar[i]) % 1000000007;
    prod *= dp[i];
    prod %= 1000000007;
  }
  cout << prod;
  return 0;
}
