#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e3 + 5;
const long long mod = 1000000007;
long long t;
long long i, j;
long long n, m, k;
long long x, y;
vector<long long> g;
long long c[maxn][maxn];
long long dp[maxn];
long long a[maxn];
long long b[maxn];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = b[i - 1] + a[i];
  }
  dp[1] = 1;
  for (i = 1; i <= 1000; i++) {
    c[i][0] = 1;
    for (j = 1; j <= i; j++) {
      if (j == 1)
        c[i][j] = i;
      else
        c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
    }
  }
  for (i = 2; i <= n; i++) {
    dp[i] = ((dp[i - 1] % mod) * (c[b[i] - 1][a[i] - 1] % mod)) % mod;
  }
  cout << dp[n];
}
