#include <bits/stdc++.h>
using namespace std;
long long ans = 1;
int n, c[1050];
inline int Read() {
  int x = 0;
  char y;
  do y = getchar();
  while (y < '0' || y > '9');
  do x = x * 10 + y - '0', y = getchar();
  while (y >= '0' && y <= '9');
  return x;
}
inline void In(int x, int y) {
  int i, j, k, l = 0;
  for (i = 2; i * i <= x; i++)
    while (x % i == 0) x /= i, c[i] += y;
  if (x > 1) c[x] += y;
  return;
}
inline void C(int x, int y) {
  for (int i = x + 1; i <= y; i++) In(i, 1);
  for (int i = 2; i <= y - x; i++) In(i, -1);
  return;
}
int main() {
  int i, j, k, l, q = 0, w, e;
  n = Read();
  for (i = 1; i <= n; i++) w = Read(), C(w - 1, w - 1 + q), q += w;
  for (i = 2; i <= 1000; i++)
    for (j = 1; j <= c[i]; j++) ans = (ans * i) % 1000000007;
  cout << ans << endl;
  return 0;
}
