#include <bits/stdc++.h>
using namespace std;
long long int dp[1010][1010];
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, k, x;
  cin >> k;
  memset(dp, 0, sizeof(dp));
  long long int ans = 1;
  n = 0;
  for (int(i) = (1); (i) < (1000 + 1); ++(i)) {
    dp[i][i] = dp[i][0] = 1;
    for (int(j) = (1); (j) < (i); ++(j)) {
      dp[i][j] = (dp[i - 1][j - 1] + dp[i - 1][j]) % 1000000007;
    }
  }
  cin >> n;
  for (int(i) = (1); (i) < (k); ++(i)) {
    cin >> x;
    ans = (ans * dp[n + x - 1][x - 1]) % 1000000007;
    n += x;
  }
  cout << ans << "\n";
  return 0;
}
