def f(A): DP=[[0]*(K+1) for _ in range(N+2)] DP[0][0]=1 for i,a in enumerate(A,1): D=DP[i-1].copy() for y in range(K,a-1,-1): D[y]|=D[y-a] DP[i]=D DP[-1][0]=1 return DP N,K=map(int,input().split()) A=list(map(int,input().split())) assert (N<=10**4) and (K<=10**3) X=f(A) Y=f(A[::-1])[::-1] Ans=0 for i in range(1,N+1): flag=1 for x in range(K+1): flag&=~(X[i-1][x]&Y[i+1][K-x]) Ans+=flag print(Ans)