#include <bits/stdc++.h>
using namespace std;
int k, s[1111], fac[1111], c[1111], sum;
int BinPow(int v, int w) {
  if (!w) return 1;
  int ans = BinPow(v, w / 2);
  ans = (ans * 1ll * ans) % 1000000007;
  if (w % 2) ans = (ans * 1ll * v) % 1000000007;
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> k;
  fac[0] = 1;
  for (int i = 1; i < 1002; i++) fac[i] = (fac[i - 1] * 1ll * i) % 1000000007;
  for (int i = 1; i <= k; i++) cin >> c[i];
  s[k + 1] = 0;
  for (int i = k; i > 0; i--) s[i] = s[i + 1] + c[i];
  sum = s[1];
  int ans = 1, cur = 1;
  for (int i = 0; i < k; i++) {
    ans = (ans * 1ll * fac[sum - s[k - i + 1] - 1]) % 1000000007;
    cur = (cur * 1ll * fac[c[k - i] - 1]) % 1000000007;
    cur = (cur * 1ll * fac[sum - s[k - i + 1] - c[k - i]]) % 1000000007;
  }
  ans = (ans * 1ll * BinPow(cur, 1000000007 - 2)) % 1000000007;
  cout << ans;
  return 0;
}
