#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int p[2010][2010], k;
int input[1010];
struct H {
  int value;
  H(int x, int y) { value = p[x + y - 1][y]; }
};
inline void createPascal() {
  for (int i = 0; i <= 2000; i++) p[i][0] = 1, p[i][i] = 1;
  for (int i = 2; i <= 2000; i++) {
    for (int j = 1; j < i; j++) {
      p[i][j] = (p[i - 1][j - 1] % mod + p[i - 1][j] % mod) % mod;
    }
  }
}
int main() {
  createPascal();
  scanf("%d", &k);
  for (int i = 0; i < k; i++) scanf("%d", &input[i]);
  int present = input[0];
  long long ans = 1;
  for (int i = 1; i < k; i++) {
    if (input[i] == 1) {
      present += 1;
      continue;
    } else {
      ans = (H(present + 1, input[i] - 1).value * ans) % mod;
    }
    present += input[i];
  }
  printf("%lld\n", ans);
  return 0;
}
