n,k = map(int,input().split()) C = list(map(int,input().split())) l = [] for i,c in enumerate(C,1): for j in range(c): l.append(i) dp = [[0]*k for i in range(1<> t & 1: continue for j in range(k): if dp[i][j] == 0: continue dp[i|1<