from collections import deque N,L=map(int,input().split()) W=list(map(int,input().split())) W.sort() dist=[-1 for i in range(W[N-1])] dist[0]=0 q=deque([0]) while len(q): i=q.pop() for j in range(N-1): if dist[(i+W[j])%W[N-1]]==-1: if i+W[j]