N=int(raw_input()) D=map(int,raw_input().split()) dp=[0 for i in range(1<0: dp[i|(1<