/*
ID: untamed
PROG: COINCHANGE2
LANG: C++
*/
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<limits>
#include<climits>
#include<cmath>
#include<functional>
#include<ctime>
#include<cstdlib>
#include<fstream>
#include<typeinfo>
const int ONE = 1<<10;
const int TWO = 1<<11;
const int FOUR = 1<<12;
const int EIGHT = 1<<13;
const int SIXTEEN = 1<<14;
const int THIRTY = 1<<15;
const int SIXTY = 1<<16;
const int ONE_HUNDRED = 1<<17;
const int TWO_HUNDRED = 1<<18;
const int FIVE_HUNDRED = 1<<19;
const int MILLION = 1<<20;
using namespace std;
typedef long long int ll;
typedef short int i16;
typedef unsigned long long int u64;
typedef unsigned int u32;
typedef unsigned short int u16;
typedef unsigned char u8;
const int MOD = 100000007;
int n,k;
int a[128];
int state[128][SIXTEEN];
void input()
{
scanf("%d %d", &n, &k);
for(int i=1;i<=n;i++)
{
scanf("%d", &a[i]);
}
}
void solve()
{
memset(state,0,sizeof(state));
int i,j;
for(i=1;i<=n;i++)
{
state[i][0]=1;
for(j=1;j<=k;j++)
{
if(j<a[i])
state[i][j]=state[i-1][j];
else
state[i][j]=(state[i][j-a[i]]+state[i-1][j])%MOD;
}
}
printf("%d\n", state[n][k]);
}
int main()
{
int i,t;
scanf("%d", &t);
for(i=1;i<=t;i++)
{
input();
printf("Case %d: ", i);
solve();
}
return 0;
}
LyoKSUQ6IHVudGFtZWQKUFJPRzogQ09JTkNIQU5HRTIKTEFORzogQysrCiovCgojaW5jbHVkZTxjc3RkaW8+CiNpbmNsdWRlPGlvc3RyZWFtPgojaW5jbHVkZTxhbGdvcml0aG0+CiNpbmNsdWRlPHN0cmluZz4KI2luY2x1ZGU8Y3N0cmluZz4KI2luY2x1ZGU8dmVjdG9yPgojaW5jbHVkZTxzdGFjaz4KI2luY2x1ZGU8cXVldWU+CiNpbmNsdWRlPGRlcXVlPgojaW5jbHVkZTxt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YW5mKCIlZCIsICZhW2ldKTsKICAgIH0KfQoKdm9pZCBzb2x2ZSgpCnsKICAgIG1lbXNldChzdGF0ZSwwLHNpemVvZihzdGF0ZSkpOwogICAgaW50IGksajsKICAgIGZvcihpPTE7aTw9bjtpKyspCiAgICB7CiAgICAgICAgc3RhdGVbaV1bMF09MTsKICAgICAgICBmb3Ioaj0xO2o8PWs7aisrKQogICAgICAgIHsKICAgICAgICAgICAgaWYoajxhW2ldKQogICAgICAgICAgICAgICAgc3RhdGVbaV1bal09c3RhdGVbaS0xXVtqXTsKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgc3RhdGVbaV1bal09KHN0YXRlW2ldW2otYVtpXV0rc3RhdGVbaS0xXVtqXSklTU9EOwogICAgICAgIH0KICAgIH0KICAgIHByaW50ZigiJWRcbiIsIHN0YXRlW25dW2tdKTsKfQoKaW50IG1haW4oKQp7CiAgICBpbnQgaSx0OwogICAgc2NhbmYoIiVkIiwgJnQpOwogICAgZm9yKGk9MTtpPD10O2krKykKICAgIHsKICAgICAgICBpbnB1dCgpOwogICAgICAgIHByaW50ZigiQ2FzZSAlZDogIiwgaSk7CiAgICAgICAgc29sdmUoKTsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==