#include <bits/stdc++.h>
using namespace std;
int c[1009];
int k;
long long fact[1009];
long long mpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (1LL * res * a) % 1000000007;
    b = b / 2;
    a = (1LL * a * a) % 1000000007;
  }
  return res;
}
long long nCr(int a, int b) {
  return (((fact[a] * mpow(fact[b], 1000000007 - 2)) % 1000000007) *
          mpow(fact[a - b], 1000000007 - 2)) %
         1000000007;
}
int main() {
  cin >> k;
  for (int i = 0; i < k; i++) cin >> c[i];
  fact[0] = 1;
  for (int i = 1; i <= 1000; i++) {
    fact[i] = (1LL * fact[i - 1] * i) % 1000000007;
  }
  long long res = 1;
  long long sum = c[0];
  for (int i = 1; i < k; i++) {
    sum += c[i];
    long long temp = nCr(sum - 1, c[i] - 1);
    res = (1LL * res * temp) % 1000000007;
  }
  res = res % 1000000007;
  cout << res << endl;
  return 0;
}
