#include <bits/stdc++.h>
using namespace std;
int k;
int c[1005];
long long fact[1005];
long long th[1005][1005];
int s[1005];
long long res;
void init() {
  fact[0] = 1;
  for (int i = 1; i <= 1000; ++i) fact[i] = (fact[i - 1] * i) % 1000000007;
  th[0][0] = 1;
  for (int i = 1; i <= 1000; ++i) {
    th[i][0] = 1;
    for (int j = 1; j <= i; ++j) {
      th[i][j] = (th[i - 1][j - 1] + th[i - 1][j]) % 1000000007;
    }
  }
}
int main() {
  init();
  scanf("%d", &k);
  for (int i = 0; i < k; ++i) {
    scanf("%d", &c[i]);
    if (i == 0)
      s[i] = c[i];
    else
      s[i] = s[i - 1] + c[i];
  }
  res = 1;
  for (int i = 1; i < k; ++i) {
    res = (res * th[s[i - 1] + c[i] - 1][c[i] - 1]) % 1000000007;
  }
  printf("%lld\n", res);
}
