from sys import stdin, exit

N = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]

if N % 3 != 0:
    print('No')
    exit()
else:
    num = []
    for k in a:
        if k not in num:
            num.append(k)
        if len(num) > 3:
            print('No')
            exit()
    if len(num) <= 2:
        print('No')
        exit()
    if num[0] ^ num[1] != num[2] and num[2] ^ num[1] != num[0] and num[0] ^ num[2] != num[1]:
        print('No')
    else:
        print('Yes')
