#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long c[1001][1001];
  for (long long i = 0; i < 1001; i++) {
    for (long long j = 0; j < i + 1; j++) {
      if (i == 0 || j == 0)
        c[i][j] = 1;
      else
        c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
      c[i][j] %= 1000000007;
    }
  }
  long long k;
  cin >> k;
  long long r[k];
  long long s = 0;
  for (long long i = 0; i < k; i++) {
    cin >> r[i];
    s += r[i];
  }
  long long ans = 1;
  for (long long i = k - 1; i >= 0; i--) {
    ans = ans * c[s - 1][r[i] - 1];
    ans %= 1000000007;
    s -= r[i];
  }
  cout << ans % 1000000007;
}
