#include <stdio.h>
int isSubsetSum(int set[], int n, int sum)
{
int subset[n+1][sum+1];
for (int i = 0; i <= n; i++)
subset[i][0] = 1;
for (int i = 1; i <= sum; i++)
subset[0][i] = 0;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= sum; j++)
{
subset[i][j] = subset[i-1][j];
if (j >= set[i-1])
subset[i][j] = subset[i-1][j] ||
subset[i - 1][j-set[i-1]];
}
}
return subset[n][sum];
}
int main()
{
int n,m,t;
scanf("%d",t);
while(t–){
scanf("%d %d",&n,&m);
int a[n];
for(int i=0;i<n;i++)
scanf("%d",a[i]);
if (isSubsetSum(a, n, m) == 1)
printf(“Yes\n”);
else
printf(“No\n”);
}
return 0;
}