#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const double Pi = 3.1415926535;
long long bin_pow(long long a, long long b) {
  if (b == 1) return a;
  if (b % 2 == 0) {
    long long c = bin_pow(a, b / 2);
    return (c * c) % 1000000007;
  } else {
    long long c = bin_pow(a, b / 2);
    return ((c * c % 1000000007) * a) % 1000000007;
  }
}
long long colors[3000];
long long n[4005];
long long k[4005];
int main() {
  int sizeI;
  cin >> sizeI;
  for (int i = 0; i < sizeI; i++) {
    cin >> colors[i];
  }
  n[1] = 1;
  k[1] = 1;
  for (int i = 2; i <= 4000; i++) {
    n[i] = n[i - 1] * i % 1000000007;
    k[i] = bin_pow(n[i], 1000000007 - 2);
  }
  long long sum = colors[0];
  long long ans = 1;
  for (int i = 1; i < sizeI; i++) {
    sum += colors[i] - 1;
    if (colors[i] == 1) {
      sum++;
      continue;
    }
    ans = (ans * (n[sum] * k[colors[i] - 1] % 1000000007) % 1000000007) *
          k[sum - (colors[i] - 1)] % 1000000007;
    sum++;
  }
  cout << ans;
}
