#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int mod_inv(long long base) {
  long long result = 1, exp = MOD - 2;
  while (exp) {
    if (exp & 1) result = (result * base) % MOD;
    exp >>= 1;
    base = (base * base) % MOD;
  }
  return result;
}
int fact(int a) {
  long long f = 1;
  for (int i = 2; i <= a; i++) f = (f * i) % MOD;
  return f;
}
int comb(int a, int b) {
  long long comb_res = 1;
  int x = max(a, b - a);
  for (int i = b; i > x; i--) comb_res = (comb_res * i) % MOD;
  return (comb_res * (mod_inv(fact(b - x)) % MOD)) % MOD;
}
int c[1001], t[1001];
int main() {
  int i, k;
  long long res = 1;
  cin >> k;
  for (i = 1; i <= k; i++) {
    cin >> c[i];
    t[i] = t[i - 1] + c[i];
  }
  for (i = 2; i <= k; i++) {
    res *= comb(c[i] - 1, t[i] - 1);
    res %= MOD;
  }
  cout << res << endl;
}
