#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
const long long MAXN = 3000;
long long calc[MAXN][MAXN];
long long C(long long k, long long n) {
  if (calc[k][n] != -1) {
    return calc[k][n];
  }
  if (k == 0) {
    calc[k][n] = 1;
    return 1;
  }
  if (k == n) {
    calc[k][n] = 1;
    return 1;
  }
  calc[k][n] = (C(k - 1, n - 1) + C(k, n - 1)) % MOD;
  return calc[k][n];
}
int main() {
  for (long long i = 0; i < MAXN; ++i) {
    for (long long j = 0; j < MAXN; ++j) {
      calc[i][j] = -1;
    }
  }
  long long k;
  cin >> k;
  long long ans = 1;
  long long csum = 0;
  for (long long i = 0; i < k; ++i) {
    long long num;
    cin >> num;
    ans = ans * C(num - 1, num - 1 + csum);
    ans %= MOD;
    csum += num;
  }
  cout << ans << endl;
  return 0;
}
