n=int(input())
l = set(map(int,input().split()))
if n % 3 != 0:
    print("No")
elif len(l) != 3:
    print("No")
else:
    l2 = list(l)
    if (l2[0] ^ l2[1] == l2[2]) and (l2[1] ^ l2[2] == l2[0]) and (l2[2] ^ l2[0] == l2[1]):
        print("Yes")
    else:
        print("No")