#include <bits/stdc++.h>
using namespace std;
long long n, i, a[1007], MOD = 1000 * 1000 * 1000 + 7, f[1000007], dp[1007], ch,
                         zn, ans = 1, tp[1007][1007], j;
int main() {
  tp[0][0] = 1;
  for (i = 1; i <= 1000; i++) {
    tp[i][0] = 1;
    for (j = 1; j <= i; j++) {
      tp[i][j] = (tp[i - 1][j] + tp[i - 1][j - 1]) % MOD;
    }
  }
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long sum = 0;
  for (i = 0; i < n; i++) {
    sum += a[i];
    ans = ans * tp[sum - 1][a[i] - 1];
    ans %= MOD;
  }
  cout << ans;
}
