N = int(input())
a = [int(i) for i in input().split()]
a.sort()
if N > 4:
    print('No')
else:
    if bin(a[0] ^ a[2]) == bin(a[1]) and bin(a[1] ^ a[2]) == bin(a[0]) and bin(a[1] ^ a[0]) == bin(a[2]):
        print('Yes')
    else:
        print('No')
