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