#include <bits/stdc++.h>
using namespace std;
long long int aa[1003][1003];
long long int comb(int n, int m) {
  int sum = 0;
  if (n == 1)
    return 1;
  else if (m == 1 || m == n - 1)
    return n;
  else if (m == n || m == 0)
    return 1;
  else {
    sum = sum + comb(n - 1, m) + comb(n - 1, m - 1);
    if (sum >= 1000000007) sum = sum % 1000000007;
  }
  return sum;
}
int main() {
  aa[0][0] = 1;
  for (int i = 1; i < 1002; i++) {
    aa[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      aa[i][j] = (aa[i - 1][j] + aa[i - 1][j - 1]) % 1000000007;
    }
  }
  int n, j;
  scanf("%d", &n);
  int a[n], sum = 0;
  long long int man = 1, woman = 1;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]), sum = sum + a[i];
  sum--;
  for (int i = n - 1; i >= 0; i--) {
    j = a[i] - 1;
    man = (man * aa[sum][j]) % 1000000007;
    sum = sum - a[i];
  }
  printf("%I64d", man);
  return 0;
}
