#include <bits/stdc++.h>
using namespace std;
int c[1005][1005], a[1005];
int main() {
  int k, total = 0;
  scanf("%d", &k);
  for (int i = 0; i < k; i++) scanf("%d", &a[i]), total += a[i];
  c[0][0] = c[1][0] = c[1][1] = 1;
  for (int i = 2; i <= total; i++) {
    c[i][i] = 1;
    for (int j = 0; j < i; j++)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % 1000000007;
  }
  long long ans = 1;
  for (int i = k - 1; i >= 0; i--) {
    ans = (ans * c[total - 1][a[i] - 1]) % 1000000007;
    total -= a[i];
  }
  printf("%I64d\n", ans);
  return 0;
}
