#include <bits/stdc++.h>
using namespace std;
long long a[1000], dp[1000][1000], i, j;
long long choose(long long n, long long k) {
  for (i = 0; i <= n; i++)
    for (j = 0; j <= min(i, k); j++)
      if (j == 0 || j == i)
        dp[i][j] = 1;
      else
        dp[i][j] = (dp[i - 1][j - 1] + dp[i - 1][j]) % 1000000007;
  return dp[n][k];
}
int main() {
  long long n, l, s = 0, ans = 1;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  for (l = n - 1; l >= 0; l--) {
    ans = (ans * choose(s - 1, a[l] - 1)) % 1000000007;
    s -= a[l];
  }
  cout << ans;
  return 0;
}
