func_code_string: #include <bits/stdc++.h>   using namespace std;   const int Mod = 1e9 + 7;   int n, inv;   long long m;   long long A[30];   inline int Qpow(int a, int b) {     int ans = 1;     while (b) {       if (b & 1) ans = (long long)ans * a % Mod;       b >>= 1;       a = (long long)a * a % Mod;     }     return ans;   }   inline int C(long long a) {     if (a < (n - 1)) return 0;     long long res = 1;     for (int i = 0; i < n - 1; i++) res = res * ((a - i) % Mod) % Mod;     return res * inv % Mod;   }   inline void Init() {     cin >> n >> m;     inv = 1;     for (int i = 2; i < n; i++) inv = (long long)inv * i % Mod;     inv = Qpow(inv, Mod - 2);     for (int i = 1; i <= n; i++) cin >> A[i];   }   inline void Work() {     int res = 0;     for (int i = 0; i < (1 << n); i++) {       long long a = n + m - 1;       int flag = 1;       for (int j = 0; j < n; j++) {         if ((i >> j) & 1) {           flag *= -1;           a -= A[j + 1] + 1;         }       }       res = ((long long)res + (long long)flag * C(a) % Mod) % Mod;     }     cout << (res + Mod) % Mod << endl;   }   int main() {     Init();     Work();     return 0;   }   