n=int(input()) a=list(map(int,input().split())) A=sum(a) L=5000*(n if n<=142 else 2) q=[0]*L q[0]=1 for v in a: for i in reversed(range(L)): if i+v