#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return b * a / gcd(a, b);
}
long long int abs1(long long int a) {
  if (a < 0)
    return -1 * a;
  else
    return a;
}
long long int max(long long int a, long long int b) {
  if (a > b) return a;
  return b;
}
int fast_pow(long long base, long long n, long long M) {
  if (n == 0) return 1;
  if (n == 1) return base;
  long long halfn = fast_pow(base, n / 2, M);
  if (n % 2 == 0)
    return (halfn * halfn) % M;
  else
    return (((halfn * halfn) % M) * base) % M;
}
int findMMI_fermat(int n, int M) { return fast_pow(n, M - 2, M); }
const double PI = 3.14159265358979323846;
long long int fac[1000000];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[100001];
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long int dp[n + 1];
  long long int sum[n + 1];
  sum[0] = 0;
  for (int i = 1; i <= n; i++) {
    sum[i] = a[i] + sum[i - 1];
  }
  fac[0] = 1;
  for (int i = 1; i <= 1000000; i++) {
    fac[i] = (fac[i - 1] % 1000000007 * i % 1000000007) % 1000000007;
    fac[i] = fac[i] % 1000000007;
  }
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    long long numerator, denominator, mmi_denominator, ans;
    numerator = fac[sum[i] - 1];
    denominator = (fac[a[i] - 1] * fac[sum[i] - a[i]]) % 1000000007;
    mmi_denominator = findMMI_fermat(denominator, 1000000007);
    ans = (numerator * mmi_denominator) % 1000000007;
    dp[i] = ans;
  }
  long long int sum1 = 1;
  for (int i = 1; i <= n; i++)
    sum1 = (sum1 % 1000000007 * dp[i] % 1000000007) % 1000000007;
  cout << sum1;
  return 0;
}
