#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long ar[1007][10007], res;
void init() {
  for (int i = 0; i < 1007; i++) ar[i][0] = 1, ar[i][i] = 1;
  for (int i = 1; i < 1007; i++)
    for (int j = 1; j < i; j++)
      ar[i][j] = (ar[i - 1][j] + ar[i - 1][j - 1]) % mod;
}
int main() {
  init();
  int k, sum = 0, foo;
  res = 1;
  cin >> k;
  for (int i = 0; i < k; i++) {
    cin >> foo;
    sum += foo;
    if (i) res = (res * ar[sum - 1][foo - 1]) % mod;
  }
  printf("%I64d\n", res);
  return 0;
}
