#include <bits/stdc++.h>
using namespace std;
const long MOD = 1000 * 1000 * 1000 + 7;
long long DP[1000 + 10][1000 + 10];
int main() {
  DP[0][0] = 1;
  for (int i = 1; i <= 1000; i++) {
    DP[i][0] = 1;
    for (int j = 1; j <= 1000; j++)
      DP[i][j] = (DP[i - 1][j - 1] + DP[i - 1][j]) % MOD;
  }
  long long k, t = 0, ans = 1;
  cin >> k;
  while (k > 0) {
    int a;
    cin >> a;
    ans = (ans * DP[t + a - 1][a - 1]) % MOD;
    t += a;
    k--;
  }
  cout << ans;
}
