#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long l[1001][1001];
long long dp[1001];
long long k, arr[1001], ps[1001];
int main() {
  cin >> k;
  for (int i = 1; i <= k; i++) {
    cin >> arr[i];
    ps[i] = ps[i - 1] + arr[i];
  }
  l[0][0] = 1;
  for (int i = 1; i < 1001; i++) {
    l[i][0] = 1;
    for (int j = 1; j < i + 1; j++) {
      l[i][j] = (l[i - 1][j - 1] + l[i - 1][j]) % mod;
    }
  }
  dp[1] = 1;
  for (int i = 2; i <= k; i++) {
    dp[i] = (l[ps[i - 1] + arr[i] - 1][ps[i - 1]] * dp[i - 1]) % mod;
  }
  cout << dp[k] << endl;
  return 0;
}
