#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007, pas[1005][1005];
class TaskC {
 public:
  void solve(istream& in, ostream& out) {
    for (int i = 0; i < 1005; i++) pas[i][0] = pas[i][i] = 1;
    for (int i = 2; i < 1005; i++)
      for (int j = 1; j < i; j++) {
        pas[i][j] = pas[i - 1][j - 1] + pas[i - 1][j];
        pas[i][j] %= mod;
      }
    int k;
    in >> k;
    long long ans = 1;
    vector<long long> c(k), psum(k);
    for (int i = 0; i < k; ++i) in >> c[i];
    partial_sum(c.begin(), c.end(), psum.begin());
    for (int i = k - 1; i > 0; i--) {
      ans *= pas[psum[i] - 1][c[i] - 1];
      ans %= mod;
    }
    out << ans;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  TaskC solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
