#include <bits/stdc++.h>
using namespace std;
long long M = 1e9 + 7;
long long triangle[2005][2005];
void makeTriangle() {
  long long i, j;
  triangle[0][0] = 1;
  for (i = 1; i < 2005; i++) {
    triangle[i][0] = 1;
    for (j = 1; j <= i; j++) {
      triangle[i][j] = (triangle[i - 1][j - 1] + triangle[i - 1][j]) % M;
    }
  }
}
long long CC(long long n, long long r) { return triangle[n][r]; }
int main() {
  makeTriangle();
  long long k, i, nw, t, ans = 1;
  cin >> k;
  vector<long long> c(k);
  for (i = 0; i < k; i++) {
    cin >> c[i];
  }
  if (k == 1) {
    cout << 1;
    return 0;
  }
  t = c[0];
  for (i = 1; i < k; i++) {
    nw = c[i] - 1;
    t += nw;
    if (nw) ans = (ans * CC(t, nw)) % M;
    t++;
  }
  cout << ans;
  return 0;
}
