I want to know what’s wrong with my logic?
for tc in (range(int(input()))):
n,m=map(int,input().split())
a=[]
[a.append(int(input())) for i in range(n)]
a.sort()
mobster = False
for i in range(n):
if mobster:
break
s=0
for j in range(i,n):
if a[n-j-1] > m:
break
else:
if s + a[n-j-1] == m:
mobster = True
break
elif s + a[n-j-1] < m:
s = s + a[n-j-1]
if mobster or m==0:
print("Yes")
else:
print("No")