#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
inline void read(int &x) {
  int f = 1;
  x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  x *= f;
}
const int maxn = 1005;
const double PI = 3.141592653589793238462643383279;
long long a[maxn], e = 1000000007;
long long power(long long a, long long n) {
  long long ans = 1;
  while (n > 0) {
    if (n & 1) {
      ans *= a;
      ans %= e;
    }
    a *= a;
    a %= e;
    n /= 2;
  }
  return ans;
}
long long fac[1000010];
int main() {
  int n;
  cin >> n;
  fac[0] = 1;
  for (int i = 1; i < 1000005; i++) fac[i] = (fac[i - 1] * i) % e;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
  }
  long long ans = 1;
  long long tot = a[1];
  for (int i = 2; i <= n; i++) {
    ans = ans * (fac[tot + a[i] - 1] * power(fac[tot], e - 2) % e) % e *
          power(fac[a[i] - 1], e - 2);
    ans %= e;
    tot += a[i];
  }
  printf("%I64d\n", ans);
}
