#include <bits/stdc++.h>   using namespace std;   long long scan_d() {     char t = getchar();     long long you = 0;     while (t >  9  || t <  0 ) t = getchar();     while (t <=  9  && t >=  0 ) {       you *= 10;       you += t -  0 ;       t = getchar();     }     return you;   }   long long dp[1050][1050];   long long op[1001];   int main() {     for (int i = 0; i <= 1010; i++) dp[1][i] = 1;     for (int i = 2; i <= 1010; i++)       for (int o = i - 1; o <= 1010; o++) {         dp[i][o] = dp[i - 1][o - 1] + dp[i][o - 1];         dp[i][o] %= 1000000007;       }     long long y;     y = scan_d();     long long sum = 0;     for (int i = 1; i <= y; i++) {       op[i] = scan_d();     }     long long ans = 1;     for (int i = 1; i <= y; i++) {       sum += op[i];       ans *= dp[op[i]][sum - 1];       ans %= 1000000007;     }     cout << ans << endl;   }   