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