#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
long long int fast_exp(long long int base, int exp) {
  if (exp == 0) return 1;
  if (exp == 1)
    return base;
  else {
    if (exp % 2 == 0) {
      long long int k, temp;
      temp = exp >> 1;
      k = fast_exp(base, temp) % mod;
      k = k % mod * k % mod;
      k %= mod;
      long long int base1 = k;
      if (base1 >= mod)
        return base1 % mod;
      else
        return base1;
    } else {
      long long int k, temp;
      temp = (exp - 1);
      temp = temp >> 1;
      k = fast_exp(base, temp) % mod;
      k = k % mod * k % mod;
      k %= mod;
      long long int ans = (base % mod);
      ans *= (k % mod);
      ans %= mod;
      if (ans >= mod)
        return ans % mod;
      else
        return ans;
    }
  }
}
int a[1005];
int main() {
  unsigned long long int n, k, i;
  unsigned long long int fans = 0, ans = 0, temp, len, seq = 0, t1;
  cin >> k;
  for (i = 1; i <= k; i++) {
    cin >> a[i];
  }
  fans = 1;
  len = 0;
  fans = 1;
  seq = 1;
  long long int num = 1, den = 1;
  for (i = 1; i <= k; i++) {
    temp = a[i];
    len++;
    temp--;
    t1 = 1;
    while (temp--) {
      seq *= (len);
      den *= t1;
      den %= mod;
      t1++;
      len++;
      seq %= mod;
    }
  }
  long long int d1 = fast_exp(den, mod - 2);
  seq *= d1;
  seq %= mod;
  cout << seq << "\n";
  return 0;
}
