#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e3 + 10;
const long long MOD = 1e9 + 7;
long long dp[MAX][MAX];
long long ncr(long long n, long long k) {
  long long& ret = dp[n][k];
  if (ret != -1) return ret;
  if (k == 0) return ret = 1;
  if (k == n) return ret = 1;
  return ret = (ncr(n - 1, k) + ncr(n - 1, k - 1)) % MOD;
}
long long arr[MAX], tot;
long long ways = 1;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  memset(dp, -1, sizeof(dp));
  int k;
  cin >> k;
  for (int(i) = (0); (i) < (k); (i)++) {
    cin >> arr[i];
    tot += arr[i];
  }
  for (int i = k - 1; i >= 0; i--) {
    long long temp = ncr(tot - 1, arr[i] - 1);
    ways = (ways * temp) % MOD;
    tot -= arr[i];
  }
  cout << (ways) << "\n";
  ;
}
