#include <bits/stdc++.h>
long long int *f;
long long int pow(long long int a, long long int b) {
  long long int x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y);
      if (x > 1000000007) x %= 1000000007;
    }
    y = (y * y);
    if (y > 1000000007) y %= 1000000007;
    b /= 2;
  }
  return x;
}
long long int InverseEuler(long long int n) { return pow(n, 1000000007 - 2); }
long long int SmallC(long long int n, long long int r) {
  return (f[n] * ((InverseEuler(f[r]) * InverseEuler(f[n - r])) % 1000000007)) %
         1000000007;
}
long long int Lucas(long long int n, long long int m) {
  if (n == 0 && m == 0) return 1;
  long long int ni = n % 1000000007;
  long long int mi = m % 1000000007;
  if (mi > ni) return 0;
  return Lucas(n / 1000000007, m / 1000000007) * SmallC(ni, mi);
}
long long int C(long long int n, long long int r) {
  if (r == 0)
    return 1;
  else
    return Lucas(n, r);
}
int main() {
  long long int k, *a, i, n;
  long long int ans;
  scanf("%I64d", &k);
  f = (long long int *)malloc(sizeof(long long int) * (1000 + 1));
  f[0] = f[1] = 1;
  for (i = 2; i < 1000 + 1; i++) f[i] = (f[i - 1] * i) % 1000000007;
  a = (long long int *)malloc(sizeof(long long int) * k);
  n = 0;
  for (i = 0; i < k; i++) {
    scanf("%I64d", &a[i]);
    n += a[i];
  }
  ans = 1;
  for (i = k - 1; i >= 0; i--) {
    ans = (ans * C(n - 1, a[i] - 1)) % 1000000007;
    n -= a[i];
  }
  printf("%I64d", ans);
  return 0;
}
