#include <bits/stdc++.h>
using namespace std;
int a[1000000];
long long m[1001][1001];
long long md = 1000000007;
long long ans = 1;
int cnt = 0;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  m[0][0] = 1;
  for (int i = 1; i <= 1000; ++i) {
    m[i][0] = 1;
    for (int j = 1; j <= 1000; ++j) {
      m[i][j] = (m[i - 1][j] + m[i - 1][j - 1]) % md;
    }
  }
  for (int i = 1; i <= n; ++i) {
    ans = (ans * (m[a[i] + cnt - 1][a[i] - 1])) % md;
    cnt += a[i];
  }
  cout << ans << endl;
}
