#include <bits/stdc++.h>
using namespace std;
long long a[1010];
long long c[1010][1010];
void preDeal() {
  c[0][0] = c[1][0] = c[1][1] = 1;
  for (int i = 1; i < 1010; i++) {
    c[i][i] = c[i][0] = 1;
    for (int j = 1; j < i; j++)
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % 1000000007;
  }
}
int main() {
  int i;
  long long k, sum, sum1;
  preDeal();
  while (scanf("%lld", &k) != EOF) {
    sum1 = 1;
    sum = 0;
    for (i = 1; i <= k; i++) {
      scanf("%lld", &a[i]);
      sum += a[i];
    }
    for (i = k; i >= 1; i--) {
      sum1 = (sum1 % 1000000007) * (c[sum - 1][a[i] - 1] % 1000000007);
      sum1 = sum1 % 1000000007;
      sum = sum - a[i];
    }
    printf("%lld\n", sum1 % 1000000007);
  }
  return 0;
}
