#include <bits/stdc++.h>
using namespace std;
int main() {
int mod = 1e9+7;
int n, target;
cin >> n >> target;
vector<int> x(n);
for (int&v : x) cin >> v;
vector<vector<int>> dp(n+1,vector<int>(target+1,0));
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
for (int j = 0; j <= target; j++) {
dp[i][j] = dp[i-1][j];
int left = j-x[i-1];
if (left >= 0) {
(dp[i][j] += dp[i][left]) %= mod;
}
}
}
cout << dp[n][target] << endl;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKICBpbnQgbW9kID0gMWU5Kzc7CiAgaW50IG4sIHRhcmdldDsKICBjaW4gPj4gbiA+PiB0YXJnZXQ7CiAgdmVjdG9yPGludD4geChuKTsKICBmb3IgKGludCZ2IDogeCkgY2luID4+IHY7CgogIHZlY3Rvcjx2ZWN0b3I8aW50Pj4gZHAobisxLHZlY3RvcjxpbnQ+KHRhcmdldCsxLDApKTsKICBkcFswXVswXSA9IDE7CiAgZm9yIChpbnQgaSA9IDE7IGkgPD0gbjsgaSsrKSB7CiAgICBmb3IgKGludCBqID0gMDsgaiA8PSB0YXJnZXQ7IGorKykgewogICAgICBkcFtpXVtqXSA9IGRwW2ktMV1bal07CiAgICAgIGludCBsZWZ0ID0gai14W2ktMV07CiAgICAgIGlmIChsZWZ0ID49IDApIHsKCShkcFtpXVtqXSArPSBkcFtpXVtsZWZ0XSkgJT0gbW9kOwogICAgICB9CiAgICB9CiAgfQogIGNvdXQgPDwgZHBbbl1bdGFyZ2V0XSA8PCBlbmRsOwp9