#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
int n, k;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    #define NAME "NUMBER"
    if(fopen(NAME".INP", "r")){
        freopen(NAME".INP", "r", stdin);
        freopen(NAME".OUT", "w", stdout);
    }
    cin >> n >> k;
    vector <int> a(n + 1);
    for(int i = 1; i <= n; i ++){
        cin >> a[i];
    }
    vector <vector <int> > dp(n + 1, vector <int> (k + 1, 0));
    dp[0][0] = 1;
    for(int i = 1; i <= n; i ++){
        for(int j = 0; j <= k; j ++){
            if(j + a[i] <= k){
                (dp[i][j + a[i]] += dp[i - 1][j]) %= mod;
            }
            if(j - a[i] >= 0){
                (dp[i][j - a[i]] += dp[i - 1][j]) %= mod;
            }
        }
    }
    cout << dp[n][0];
    return 0;
}
