#include <bits/stdc++.h>
using namespace std;
long long k, c[1002], a[1002][1002], sum = 0, f[1002];
int main() {
  a[0][1] = 1;
  a[1][1] = 1;
  a[1][2] = 2;
  for (long long i = 2; i < 1002; i++) {
    a[0][i] = 1;
    a[1][i] = i;
    for (long long j = 1; j <= i; j++) {
      a[j][i] = (a[j - 1][i - 1] + a[j][i - 1]) % 1000000007;
    }
  }
  scanf("%I64d", &k);
  for (long long i = 1; i <= k; i++) {
    scanf("%I64d", &c[i]);
  }
  sum = c[1];
  f[1] = 1;
  for (long long i = 2; i <= k; i++) {
    if (sum > 1)
      f[i] = (f[i - 1] * a[sum][sum + c[i] - 1]) % 1000000007;
    else if (sum == 1)
      f[i] = (f[i - 1] * (c[i])) % 1000000007;
    sum += c[i];
  }
  printf("%I64d\n", f[k]);
  return 0;
}
