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