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