#include <bits/stdc++.h>
using namespace std;
double Fib(double x, double z);
string BinDec(unsigned long long x);
string StringInt(long long x);
unsigned long long StringInt(string x);
unsigned long long BinDec(string x);
unsigned long long POWMOD(unsigned long long x, unsigned long long y,
                          unsigned long long mod);
unsigned long long POWE(long long, long long);
long long fast_pow(long long a, long long b, long long mod) {
  if (b == 0) return 1ll;
  long long ans = 1;
  if (b % 2) return ans = (fast_pow(a, b - 1, mod) * a) % mod;
  ans = (fast_pow(a, b / 2, mod) % mod);
  return ((ans * ans) % mod);
}
long long arr[1020] = {};
long long nCp(long long a, long long b) {
  long long ans2 = 1, mod = 1000000007;
  if (b > a)
    return 0;
  else if (b == a)
    return 1;
  else {
    ans2 = arr[a];
    ans2 *= fast_pow(arr[a - b], mod - 2, mod);
    ans2 %= mod;
    ans2 *= fast_pow(arr[b], mod - 2, mod);
    ans2 %= mod;
    return ans2;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, i;
  arr[0] = 1;
  long long mod = 1000000007, ans = 1;
  for (i = 1; i < 1003; i++) {
    ans *= i;
    ans %= mod;
    arr[i] = ans;
  }
  long long s = 0, p = 1, a;
  cin >> n;
  cin >> a;
  s = a;
  for (i = 1; i < n; i++) {
    cin >> a;
    p *= nCp(s + a - 1, a - 1);
    p %= mod;
    s += a;
  }
  cout << p;
  return 0;
}
