#include <bits/stdc++.h>
using namespace std;
long long dp[1011][1011];
int a[100005];
inline void Init() {
  dp[0][0] = 1;
  for (int i = 1; i <= 1010; i++) {
    dp[i][i] = dp[i][0] = 1;
    for (int j = 1; j < i; j++) {
      dp[i][j] = (dp[i - 1][j] + dp[i - 1][j - 1]) % 1000000007;
    }
  }
}
int main() {
  Init();
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  long long sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  long long ans = 1;
  for (int i = n - 1; i >= 0; i--) {
    ans *= dp[sum - 1][a[i] - 1];
    ans %= 1000000007;
    sum -= a[i];
  }
  cout << ans;
}
