#include <bits/stdc++.h>   using namespace std;   int MOD = 1000000007;   int dp[1001][1001];   int main() {     int k;     cin >> k;     int balls[1000];     int n = 0;     for (int i = 0; i < k; i++) {       cin >> balls[i];       n += balls[i];     }     long long l = 1;     for (int i = 0; i <= n; i++) {       dp[i][0] = 1;       dp[i][i] = 1;       for (int j = 1; j <= i; j++) {         dp[i][j] = (dp[i - 1][j] + dp[i - 1][j - 1]) % MOD;       }     }     long long ans = 1;     int cur = balls[0];     for (int i = 1; i < k; i++) {       cur += balls[i];       ans = ((ans % MOD) * (dp[cur - 1][balls[i] - 1]) % MOD) % MOD;     }     cout << ans << endl;     return 0;   }   