#include <bits/stdc++.h>
using namespace std;
const int m = 1e9 + 7;
int c[1012][1012];
long long int n, k, t, res = 1, all;
int main() {
  for (int i = 0; i < 1012; i++) c[0][i] = 1;
  for (int i = 1; i < 1012; i++) {
    c[i][0] = 1, c[i][i] = 1;
    for (int j = 1; j < i; j++) c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % m;
  }
  cin >> k;
  while (k--) {
    cin >> t;
    all += t;
    res = ((long long int)c[all - 1][t - 1] * res) % m;
  }
  cout << res << endl;
  return 0;
}
