func_code_string: #include <bits/stdc++.h>   using namespace std;   long long n;   long long a[1005];   long long fac[1000005];   long long ppow(long long a, long long b) {     long long c = 1;     while (b) {       if (b & 1) c = c * a % 1000000007;       a = a * a % 1000000007;       b >>= 1;     }     return c;   }   long long work(long long m, long long i) {     return ((fac[m] % 1000000007) *             (ppow((fac[i] * fac[m - i]) % 1000000007, 1000000007 - 2) %              1000000007)) %            1000000007;   }   int main() {     long long i, j, k;     fac[0] = 1;     for (int i = 1; i < 1000005; i++) {       fac[i] = (fac[i - 1] * i) % 1000000007;     }     long long ans = 1, sum = 0;     cin >> n;     for (int i = 1; i <= n; i++) {       cin >> a[i];       sum += a[i];     }     for (int i = n; i >= 1; i--) {       ans *= work(sum - 1, a[i] - 1);       ans %= 1000000007;       sum -= a[i];     }     cout << ans << endl;   }   