#include <bits/stdc++.h>
using namespace std;
const int N = 1000 + 5;
const int Mod = (int)1e9 + 7;
int C[N][N];
int n, a[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  C[0][0] = 1;
  for (int i = 1; i <= 1000; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= 1000; j++)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % Mod;
  }
  int sum = 0;
  for (int i = 1; i <= n; i++) sum += a[i];
  long long ans = 1;
  for (int i = n; i >= 1; i--) {
    ans = ans * C[sum - 1][a[i] - 1] % Mod;
    sum -= a[i];
  }
  printf("%I64d\n", ans);
  return 0;
}
