#include <bits/stdc++.h>
using namespace std;
long long int ncr[1005][1005];
void calculate() {
  ncr[0][0] = 1;
  for (int i = 1; i < 1005; ++i) {
    for (int j = 0; j < 1005; ++j) {
      if (i < j) {
        ncr[i][j] = 0;
        continue;
      }
      if (j == 0)
        ncr[i][j] = 1;
      else
        ncr[i][j] = (ncr[i - 1][j] + ncr[i - 1][j - 1]) % 1000000007;
    }
  }
}
int main() {
  calculate();
  for (int i = 0; i < 10; ++i) {
    for (int j = 0; j < 10; ++j) {
    }
  }
  int k;
  cin >> k;
  int a[k + 1];
  for (int i = 1; i <= k; ++i) {
    cin >> a[i];
  }
  long long int f[k + 1];
  f[1] = 1;
  int sum = a[1];
  for (int i = 2; i <= k; ++i) {
    f[i] = ncr[sum + a[i] - 1][a[i] - 1] % 1000000007;
    f[i] *= f[i - 1];
    f[i] %= 1000000007;
    sum += a[i];
  }
  cout << f[k] << endl;
  return 0;
}
