#include <bits/stdc++.h>
using namespace std;
long long cc[1010][1010];
void Init() {
  for (int n = 0; n <= 1000; n++) {
    for (int m = 0; m <= n; m++) {
      if (m == 0 || n == m)
        cc[n][m] = 1;
      else
        cc[n][m] = cc[n - 1][m] % 1000000007 + cc[n - 1][m - 1] % 1000000007;
    }
  }
}
int a[10000];
int main() {
  Init();
  int n;
  scanf("%d", &n);
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  int last = n;
  long long way = 1;
  while (last >= 1) {
    way = way * cc[sum - 1][a[last] - 1] % 1000000007;
    sum -= a[last];
    last--;
  }
  printf("%I64d\n", way % 1000000007);
  return 0;
}
