#include<cstdio> usingnamespace std; template <classType> voidread(Type &x) { char c; bool flag = false; while ((c = getchar()) < '0' || c > '9') c == '-' && (flag = true); x = c - '0'; while ((c = getchar()) >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0'; if (flag) x = ~x + 1; } template <classType, class ...rest> voidread(Type &x, rest &...y){ read(x), read(y...); } template <classType> voidwrite(Type x) { if (x < 0) putchar('-'), x = ~x + 1; if (x > 9) write(x / 10); putchar(x % 10 + '0'); } typedeflonglong LL; constint N = 30, mod = 1e9 + 7; voidadj(int &x) { x += x >> 31 & mod; } LL m, w[N]; int n, inv[N]; voidinit() { inv[1] = 1; for (int i = 2; i <= n; ++i) inv[i] = (LL)(mod - mod / i) * inv[mod % i] % mod; } intC(LL a, int b) { if (a < 0 || b < 0 || a < b) return0; a %= mod; if (!a || !b) return1; int res = 1; for (int i = 0; i < b; ++i) res = (LL)res * (a - i) % mod; for (int i = 1; i <= b; ++i) res = (LL)res * inv[i] % mod; return res; } intmain() { read(n, m); init(); for (int i = 1; i <= n; ++i) read(w[i]); int res = 0; for (int i = 0; i < 1 << n; ++i) { LL t = n + m - 1; int p = 0; for (int j = 0; j < n; ++j) if (i >> j & 1) ++p, t -= w[j + 1] + 1; p & 1 ? adj(res -= C(t, n - 1)) : adj(res += C(t, n - 1) - mod); } write(res); return0; }