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

if n%3 == 0:
    if len(b) == 1:
        if a[0] == 0:
            print('Yes')
        else:
            print('No')
    elif len(b) == 2:
        print('No')
    elif len(b) == 3:
        if b[0]^b[1] == b[2]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
elif n%3 == 1:
    if b == [0]:
        print('Yes')
    else:
        print('No')
else:
    if b==[0]:
        print('Yes')
    else:
        print('No')