N=int(input()) A=[int(x) for x in input().split()] s=[0]*(1<0: s[i]+=A[j] dp={} def f(a,b,t): if (a|b)==(1<2*s[b] else 0 c=int((a|(b<