#include <bits/stdc++.h>
using namespace std;
long long quick_mod(long long a, long long b) {
  long long ans = 1;
  a %= 1000000007;
  while (b) {
    if (b % 2 != 0) {
      ans = ans * a % 1000000007;
      b--;
    }
    b /= 2;
    a = a * a % 1000000007;
  }
  return ans;
}
long long judge(long long n, long long m) {
  if (m > n) return 0;
  long long ans = 1;
  for (long long i = 1; i <= m; i++) {
    long long a = (n + i - m) % 1000000007;
    long long b = i % 1000000007;
    ans = ans * (a * quick_mod(b, 1000000007 - 2) % 1000000007) % 1000000007;
  }
  return ans;
}
long long work(long long n, long long m) {
  if (m == 0) return 1;
  return judge(n % 1000000007, m % 1000000007) *
         work(n / 1000000007, m / 1000000007) % 1000000007;
}
int main() {
  long long m, n, i, j, k, ans = 1, a[10005], t = 0, count;
  while (cin >> m) {
    for (i = 1; i <= m; i++) cin >> a[i];
    ans = 1;
    long long sum = a[1];
    for (i = 2; i <= m; i++) {
      sum += a[i];
      ans = (ans * work(sum - 1, a[i] - 1)) % 1000000007;
    }
    cout << ans % 1000000007 << endl;
  }
}
