N=int(input())
a_list=list(map(int,input().split()))
if N%3!=0:
  print("No")
else:
    a=set(a_list)
    a=list(a)
    if 0 in a:
            b=a_list.pop(0)
            if len(b)==len(a_list)*2//3:
                print("Yes")
            else:
                print("No")
    else:
            a1=a[0]
            a2=a[1]
            a3=a[2]
            if a1 ^ a2 ==a3 and a1^a3==a2:
                if a_list.count(a1) ==a_list.count(a2) ==a_list.count(a3):
                    print("Yes")
                else:
                    print("No")
            else:
                print("No")