#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
const long long int mod = 1e9 + 7;
long long int comb[MAXN][MAXN];
int arr[MAXN];
int main() {
  ios::sync_with_stdio(false);
  int k;
  cin >> k;
  for (int i = 0; i < k; i++) {
    cin >> arr[i];
  }
  comb[0][0] = 1;
  for (int i = 1; i < MAXN; i++) {
    comb[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      comb[i][j] = (comb[i - 1][j] + comb[i - 1][j - 1]) % mod;
    }
  }
  int colors = 0;
  long long int ans = 1;
  for (int i = 0; i < k; i++) {
    ans = (ans * comb[colors + arr[i] - 1][arr[i] - 1]) % mod;
    colors += arr[i];
  }
  cout << ans;
}
