template <typename _Tp> voidread(_Tp &a, char c = 0){ for (c = getchar(); !isdigit(c); c = getchar()); for(a = 0; isdigit(c); a = a * 10 + c - '0', c = getchar()); }
int a[N], n, m; ll \text{dp}[N][N];
intmain(){ //freopen("t5.in", "r", stdin); read(n), read(m); for(int i = 1; i <= n; i++) { read(a[i]); } \text{dp}[0][0] = 1; for(int i = 1; i <= n; i++) { for(int j = 0; j <= m; j++) { for(int k = 0; k <= a[i]; k++) { if(j - k >= 0) { \text{dp}[i][j] = (\text{dp}[i][j] + \text{dp}[i - 1][j - k]) % MOD; } } } } cout << \text{dp}[n][m] << endl; return0; }