#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000 + 10;
long long int c[MAX_N][MAX_N], dp[MAX_N], x[MAX_N], y[MAX_N];
int main() {
  long long int n, m = 1000000007;
  cin >> n;
  y[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    y[i] = x[i] + y[i - 1];
  }
  for (int i = 0; i < MAX_N; i++) {
    c[i][0] = 1;
    c[i][i] = 1;
  }
  for (int i = 1; i < MAX_N; i++) {
    for (int j = 1; j < i; j++) {
      c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
      c[i][j] %= m;
    }
  }
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    dp[i] = c[y[i] - 1][x[i] - 1];
    dp[i] %= m;
    dp[i] *= dp[i - 1];
    dp[i] %= m;
  }
  long long int ans = dp[n];
  cout << ans;
}
