#include <bits/stdc++.h>
using namespace std;
int k;
long long dp[1001][1001];
long long mod(long long a) { return a % 1000000007; }
long long sum(long long a, long long b) { return mod(mod(a) + mod(b)); }
long long mul(long long a, long long b) { return mod(mod(a) * mod(b)); }
void initdp() {
  for (int i = 0; i < 1001; ++i) dp[i][0] = dp[i][i] = 1;
  for (int i = 1; i < 1001; ++i) {
    for (int j = 1; j < 1001; ++j) {
      dp[i][j] = sum(dp[i - 1][j - 1], dp[i - 1][j]);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  initdp();
  while (cin >> k) {
    vector<long long> v(k);
    long long ans = 1, aux = 0;
    for (int i = 0; i < k; ++i) cin >> v[i];
    aux = v[0];
    for (int i = 1; i < k; ++i) {
      aux += v[i];
      ans = mul(ans, dp[aux - 1][v[i] - 1]);
    }
    cout << ans << "\n";
  }
}
