#include <bits/stdc++.h>
using namespace std;
int const MOD = 1000000007, MAX = 10000;
int binomialCoeff(int n, int k) {
  int C[n + 1][k + 1];
  int i, j;
  for (i = 0; i <= n; i++) {
    for (j = 0; j <= min(i, k); j++) {
      if (j == 0 || j == i)
        C[i][j] = 1;
      else
        C[i][j] = (((C[i - 1][j - 1] % MOD) + (C[i - 1][j] % MOD)) % MOD);
    }
  }
  return C[n][k];
}
int main() {
  int s = 0;
  vector<int> sumas, val;
  int n;
  scanf("%d", &n);
  long long memo[n + 1];
  memset(memo, 0, sizeof(memo));
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    s += x;
    sumas.push_back(s);
    val.push_back(x);
  }
  memo[0] = 1;
  for (int i = 1; i < n; i++) {
    int cn = sumas[i] - 1;
    int ck = val[i] - 1;
    memo[i] = (((memo[i - 1] % MOD) * (binomialCoeff(cn, ck) % MOD)) % MOD);
  }
  printf("%d\n", memo[n - 1]);
  return 0;
}
