#include <bits/stdc++.h>
using namespace std;
const int mo = 1e9 + 7;
int n, a[1005];
long long c[1005][1005], ans = 1;
void pai() {
  c[0][0] = 1;
  for (int i = 1; i < 1005; i++) {
    c[i][i] = c[i][0] = 1;
    for (int j = 1; j < i; j++) c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mo;
  }
}
int main() {
  pai();
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  for (int i = n - 1; i > 0; i--) {
    ans *= c[sum - 1][a[i] - 1];
    ans %= mo;
    sum -= a[i];
  }
  cout << ans << endl;
  return 0;
}
