func_code_string: #include <bits/stdc++.h>   using namespace std;   namespace IO {   const int sz = 1 << 20;   char a[sz + 5], b[sz + 5], *p1 = a, *p2 = a, *t = b, p[105];   inline char gc() {     return getchar();     if (p1 == p2) p2 = (p1 = a) + fread(a, 1, sz, stdin);     return *p1++;   }   template <class T>   inline T read() {     T ret = 0;     char c = gc();     int f = 1;     for (; c <  0  || c >  9 ; c = gc())       if (c ==  - ) f = -1;     for (; c >=  0  && c <=  9 ; c = gc()) ret = ret * 10 + (c -  0 );     return ret * f;   }   template <class T>   inline void read(T& ret) {     ret = read<T>();   }   inline void flush() { fwrite(b, 1, t - b, stdout), t = b; }   inline void pc(char x) {     *t++ = x;     if (t - b == sz) flush();   }   template <class T>   inline void print(T x, char c =   n ) {     if (x < 0) x = -x, pc( - );     if (x == 0) pc( 0 );     int t = 0;     for (; x; x /= 10) p[++t] = x % 10 +  0 ;     for (; t; --t) pc(p[t]);     pc(c);   }   struct F {     ~F() { flush(); }   } f;   }  // namespace IO   using IO::print;   using IO::read;   const int mo = 1e9 + 7;   inline int add(int a, int b) { return a + b < mo ? a + b : a + b - mo; }   inline int dec(int a, int b) { return a < b ? a + mo - b : a - b; }   inline int mul(int a, int b) { return 1LL * a * b % mo; }   const int N = 1e3 + 10;   int k;   int c[N], s[N];   int C[N][N];   int f[N];   int main() {     for (int i = 0; i <= 1000; i++) C[i][0] = C[0][i] = 1;     C[0][0] = 0;     for (int i = 1; i <= 1000; i++)       for (int j = 1; j <= 1000; j++) C[i][j] = add(C[i - 1][j], C[i][j - 1]);     read(k);     for (int i = 1; i <= k; read(c[i]), s[i] = add(s[i - 1], c[i]), i++)       ;     f[1] = 1;     for (int i = 2; i <= k; i++) f[i] = mul(f[i - 1], C[s[i - 1]][c[i] - 1]);     print(f[k]);     return 0;   }   