#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &x) {
  int f = 1;
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
const int N = 1000 + 5;
const int mo = 1000000007;
int n;
long long a[N], f[N], inv[N], g[N];
void exgcd(long long a, long long b, long long &x, long long &y) {
  if (!b) {
    x = 1, y = 0;
    return;
  }
  exgcd(b, a % b, y, x);
  y -= x * (a / b);
}
long long get(int n, int m) { return f[n + m] * inv[n] % mo * inv[m] % mo; }
int main() {
  read(n);
  f[0] = 1;
  for (int i = 1; i <= 1000; i++) f[i] = f[i - 1] * i % mo;
  long long y;
  exgcd(f[1000], mo, inv[1000], y);
  for (int i = 999; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % mo;
  for (int i = 1; i <= n; i++) read(a[i]);
  long long tmp = a[1];
  g[1] = 1;
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j < a[i]; j++)
      (g[i] += g[i - 1] * get(tmp - 1, j) % mo) %= mo;
    tmp += a[i];
  }
  if (g[n] < 0) g[n] += mo;
  printf("%lld\n", g[n]);
  return 0;
}
