input()
a=list(map(int,input().split()))
if len(a)%3==0:
    b=list(set(a))
    if len(b)==3:
        b=[format(i, '032b') for i in b]
        b=[(int(b[0][i])+int(b[1][i]))%2==int(b[2][i]) for i in range(32)]
        if False in b:
            print("No")
        else:
            print("Yes")
    else:
        print("No")
else:
    print("No")