#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::sort;
using std::string;
using std::swap;
long long inv(long long a, long long p) {
  return a == 1 ? 1 : inv(p % a, p) * (p - p / a) % 1000000007;
}
long long fact[1010], afact[1010];
void initfact() {
  fact[0] = afact[0] = 1;
  for (int i = 1; i < 1010; ++i) {
    fact[i] = fact[i - 1] * i % 1000000007;
    afact[i] = inv(fact[i], 1000000007);
  }
}
long long C(long long a, long long b) {
  return fact[a] * afact[b] % 1000000007 * afact[a - b] % 1000000007;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  initfact();
  {
    int n;
    while (cin >> n) {
      long long a[n];
      for (int i = 0; i < n; ++i) cin >> a[i];
      long long sum = 1, all = 0, nowsum = 1;
      for (int i = 0; i < a[0]; ++i) nowsum = nowsum * (++all) % 1000000007;
      for (int i = 1; i < n; ++i) {
        for (int j = 0; j < a[i] - 1; ++j)
          nowsum = nowsum * (++all) % 1000000007;
        sum = sum * nowsum % 1000000007 * afact[a[i] - 1] % 1000000007 *
              afact[all - a[i] + 1] % 1000000007;
        nowsum = nowsum * (++all) % 1000000007;
      }
      cout << sum << endl;
    };
  }
  return 0;
};
