#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long found[1005];
long long qpow(long long a, long long b) {
  a = a % mod;
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  found[1] = 1;
  for (int i = 2; i <= 1000; ++i) {
    found[i] = found[i - 1] * i % mod;
  }
  int n, now;
  long long res = 1;
  int cnt = 1;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> now;
    if (now >= 2) res = qpow(found[now - 1], mod - 2) * res % mod;
    for (int j = 0; j < now - 1; ++j) {
      res = res * cnt % mod;
      ++cnt;
    }
    ++cnt;
  }
  cout << res;
  return 0;
}
