#include <bits/stdc++.h>
using namespace std;
void gcd(long long a, long long b, long long &d, long long &x, long long &y) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    gcd(b, a % b, d, y, x);
    y -= x * (a / b);
  }
}
long long inv(long long a, long long n) {
  long long d, x, y;
  gcd(a, n, d, x, y);
  return d == 1 ? (x + n) % n : -1;
}
long long func_c(long long n, long long k) {
  long long ans = 1, ans2 = 1;
  if (n - k < k) k = n - k;
  for (long long i = 0; i < k; i++) ans *= n - i, ans %= 1000000007;
  for (long long i = 1; i <= k; i++) ans2 *= i, ans2 %= 1000000007;
  ans2 = inv(ans2, 1000000007);
  ans *= ans2;
  ans %= 1000000007;
  return ans;
}
const int maxn = 10010;
long long a[maxn];
int main() {
  int n;
  cin >> n;
  long long ans = 1, nn = 0, kk = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    nn += a[i];
    ans = ans * func_c(nn - 1, kk);
    ans %= 1000000007;
    kk += a[i];
  }
  cout << ans << endl;
  return 0;
}
