n = int(input())
a = list(map(int, input().split()))

if n % 3 == 0 and len(set(a)) == 3:
    x = list(set(a))
    a = x[0]
    b = x[1]
    c = x[2]
    if a ^ b != c:
        print('No')
        exit()
    if b ^ c != a:
        print('No')
        exit()
    if c ^ a != b:
        print('No')
        exit()
    print('Yes')

else:
    print('No')