#include <bits/stdc++.h>
using namespace std;
int n, a[1003];
const int mod = 1000000007;
int comb[1005][1005], i, j;
int main() {
  int lim = 1002;
  for (i = 1; i <= lim; i++) comb[i][i] = comb[i][0] = 1;
  for (i = 2; i <= lim; i++)
    for (j = 1; j < i; j++) {
      long long aux = comb[i - 1][j] + comb[i - 1][j - 1];
      aux %= mod;
      comb[i][j] = aux;
    }
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  long long ans = 1;
  long long nr = a[1];
  for (i = 2; i <= n; i++) {
    int en = a[i] - 1;
    ans = (1LL * ans * comb[en + nr][en]) % mod;
    nr += a[i];
  }
  cout << ans;
  return 0;
}
