#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
const int MOD = 1e9 + 7;
long long c[N][N];
void prepare() {
  c[0][0] = 1;
  int i, j;
  for (i = 1; i < N; i++) {
    c[i][i] = c[i][0] = 1;
    for (j = 1; j < i; j++) c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD;
  }
}
int main() {
  prepare();
  int k;
  cin >> k;
  int a[1005], i, tol = 0;
  for (i = 0; i < k; i++) {
    cin >> a[i];
    tol += a[i];
  }
  long long ans = 1;
  for (i = k - 1; i >= 0; i--) {
    ans *= c[tol - 1][a[i] - 1];
    ans %= MOD;
    tol -= a[i];
  }
  cout << ans << endl;
  return 0;
}
