#include <bits/stdc++.h>
long long mod = 1000000007;
using namespace std;
long long a[1005], b[1005], c[1005][1005];
long long k;
void init() {
  c[0][0] = 1;
  for (int i = 1; i <= 1000; i++) {
    for (int j = 0; j <= 1000; j++) {
      if (!j)
        c[i][j] = 1;
      else
        c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;
    }
  }
}
int main() {
  init();
  scanf("%I64d", &k);
  for (long long i = 1; i <= k; i++) {
    scanf("%I64d", &a[i]);
    b[i] = b[i - 1] + a[i];
  }
  long long ans = 1;
  for (int i = k; i >= 1; i--) ans = (ans * c[b[i] - 1][a[i] - 1]) % mod;
  printf("%I64d", ans);
  return 0;
}
