#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool sortbydesc(const pair<long long int, long long int> &a,
                const pair<long long int, long long int> &b) {
  if (a.second < b.second)
    return true;
  else
    return false;
}
long long int bin[1001][1001];
long long int binomial(long long int n, long long int k) {
  if (bin[n][k] != -1) return bin[n][k];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int bin[1001][1001];
  memset(bin, 0, sizeof(bin));
  bin[1][0] = 1 % 1000000007;
  bin[1][1] = 1 % 1000000007;
  for (long long int i = 2; i < 1001; i++) {
    bin[i][0] = 1 % 1000000007;
    for (long long int j = 1; j < i + 1; j++) {
      bin[i][j] = (bin[i - 1][j] + bin[i - 1][j - 1]) % 1000000007;
    }
  }
  vector<long long int> v, k;
  long long int a;
  v.push_back(0);
  k.push_back(0);
  for (long long int i = 1; i < n + 1; i++) {
    cin >> a;
    k.push_back(a);
    v.push_back(a + v[i - 1]);
  }
  long long int ans = 1;
  for (long long int i = 2; i < n + 1; i++) {
    ans = (ans * bin[v[i] - 1][k[i] - 1]) % 1000000007;
  }
  cout << ans;
}
