#include <bits/stdc++.h>
using namespace std;
int cnt[1005];
long long c[1005][1005];
int main() {
  c[0][0] = c[1][0] = c[1][1] = 1;
  for (int i = 2; i <= 1000; i++) {
    for (int j = 0; j <= i; j++) {
      if (i == 0 || i == j)
        c[i][j] = 1;
      else
        c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % 1000000007;
    }
  }
  int k;
  cin >> k;
  for (int i = 1; i <= k; i++) {
    int t;
    cin >> cnt[i];
  }
  long long ans = 1;
  int cs = 0;
  for (int i = 1; i <= 1000; i++) {
    if (cnt[i]) {
      ans = (ans * c[cs + cnt[i] - 1][cnt[i] - 1]) % 1000000007;
      cs += cnt[i];
    }
  }
  cout << ans << endl;
}
