/*
********** Enigm@tic :*: T.L.G.Hiếu @nd HieuT.L.G_aming **********
*** Viet N@m - Th@nh Ho@ - L@m Son High school ***
*/
#include <bits/stdc++.h>
using namespace std;
#define hh return;
#define hieupcc int main()
#define t_l_g_h return 0;
#define pb push_back
#define po pop_back
#define ll long long
#define se second
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pll pair<ll,ll>
#define pi pair<int,int>
#define v vector<ll>
#define g_h_p_c break;
#define hh return;
#define NMAX 101
//*************************************************************//
int n,k,a[NMAX],m,of=2*1e5 ;
const int mod = 1e9 + 7 ;
const int MAXXXXXXXX = 3*1e5 ;
int dp[2][MAXXXXXXXX + 3],t;
int main()
{
freopen("PG18R3.INP","r",stdin);
freopen("PG18R3.OUT","w",stdout);
fast
cin>>t;
while(t--){
int s=0;
cin>>n>>m;
memset(dp,0,sizeof(dp));
for(int i=1;i<=n;i++){
cin>>a[i];
s+=abs(a[i]);
}
if(s<abs(m)){
cout<<0<<'\n';
continue;
}
dp[0&1][of]=1;
for(int i=1;i<=n;i++){
fill ( dp[i&1] , dp[i&1] +MAXXXXXXXX + 1 , 0 );
for(int j=-s;j<=s;j++){
dp[i&1][j+of]=(dp[(i-1)&1][j-a[i]+of]%mod+dp[(i-1)&1][j+a[i]+of]%mod)%mod;
}
}
cout<<dp[n&1][m+of]<<'\n';
}
return 0;
}
// số cách tạo ra tổng of khi đến vị trí i
// 0 1 3
// 0 + 1 - 3
// - 0 + 1 -3
// -1 + 2 = 1
// -2 + 1 = -1
// 6 + 7 + 3 = 16
// -10 + -9 + -13 =
LyoKKioqKioqKioqKiBFbmlnbUB0aWMgOio6IFQuTC5HLkhp4bq/dSBAbmQgSGlldVQuTC5HX2FtaW5nICoqKioqKioqKioKKioqICAgICAgICAgVmlldCBOQG0gLSBUaEBuaCBIb0AgLSBMQG0gU29uIEhpZ2ggc2Nob29sICAgICAgICAgKioqCiovCiNpbmNsdWRlIDxiaXRzL3N0ZGMrKy5oPgp1c2luZ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Y291dDw8MDw8J1xuJzsKICAgICAgICBjb250aW51ZTsKICAgICAgfQogICAgICBkcFswJjFdW29mXT0xOwogICAgICBmb3IoaW50IGk9MTtpPD1uO2krKyl7CiAgICAgIAlmaWxsICggZHBbaSYxXSAsIGRwW2kmMV0gK01BWFhYWFhYWFggKyAxICwgMCApOwogICAgICAgICBmb3IoaW50IGo9LXM7ajw9cztqKyspeyAKICAgICAgICAgICAgZHBbaSYxXVtqK29mXT0oZHBbKGktMSkmMV1bai1hW2ldK29mXSVtb2QrZHBbKGktMSkmMV1baithW2ldK29mXSVtb2QpJW1vZDsKICAgICAgICAgfQogICAgICB9CiAgICAgIGNvdXQ8PGRwW24mMV1bbStvZl08PCdcbic7CiAgICB9CiAgICByZXR1cm4gMDsKfQovLyBz4buRIGPDoWNoIHThuqFvIHJhIHThu5VuZyBvZiBraGkgxJHhur9uIHbhu4sgdHLDrSBpCi8vIDAgMSAzCi8vIDAgKyAxIC0gMwovLyAtIDAgKyAxIC0zCi8vIC0xICsgMiA9IDEKLy8gLTIgKyAxID0gLTEKLy8gNiArIDcgKyAzID0gMTYKLy8gLTEwICsgLTkgKyAtMTMgPQo=