#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007L;
int k;
int c[1000];
long long leftSum[1000];
long long nn[1001];
long long coolPow(long long x, long long y) {
  if (y == 0) return 1;
  if (y == 1) return x;
  long long pp = coolPow(x, y / 2);
  return (((pp * pp) % mod) * coolPow(x, y % 2)) % mod;
}
long long N(long long k) {
  if (k == 1) return 1;
  if (nn[k]) return nn[k];
  long long sum = N(k - 1);
  long long left = 1;
  long long s = 1;
  for (; left < c[k - 1]; left++) {
    s = (s * (leftSum[k - 2] + left - 1)) % mod;
    long long leftInv = coolPow(left, mod - 2);
    s = (s * leftInv) % mod;
    sum = (sum + N(k - 1) * s) % mod;
  }
  nn[k] = sum;
  return sum;
}
int main(int argc, char *argv[]) {
  cin >> k;
  for (int i = 0; i < k; i++) cin >> c[i];
  leftSum[0] = c[0];
  for (int i = 1; i < k; i++) leftSum[i] = leftSum[i - 1] + c[i];
  cout << N(k) << endl;
  return 0;
}
