#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int k, A[1005], choose[1005][1005];
int solve(int pos, int cnt) {
  if (pos == 1) return 1;
  return ((long long)solve(pos - 1, cnt - A[pos]) *
          choose[cnt - 1][A[pos] - 1]) %
         mod;
}
int main() {
  scanf("%d", &k);
  int s = 0;
  for (int i = 1; i <= k; i++) {
    scanf("%d", &A[i]);
    s += A[i];
  }
  for (int i = 0; i <= 1001; i++) {
    choose[i][0] = 1;
  }
  for (int i = 1; i <= 1001; i++) {
    for (int j = 1; j <= 1001; j++) {
      choose[i][j] = (choose[i - 1][j] + choose[i - 1][j - 1]) % mod;
    }
  }
  printf("%d\n", solve(k, s));
  return 0;
}
