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

def f(a, b, c):
    if a ^ b == c and a ^ c == b and b ^ c == a:
        return True
    else:
        return False

if N % 3 != 0:
    x = a[0]
    for i in range(len(a)):
        if a[i] != x:
            print("No")
            exit()
    if f(x, x, x):
        print("Yes")
    else:
        print("No")

else:
    flag = 0
    x = [-1, -1, -1]
    for i in range(len(a)):
        if a[i] not in x:
            if flag == 3:
                print("No")
                exit()

            x[flag] = a[i]
            flag += 1

    if flag == 3:
        if f(x[0], x[1], x[2]):
            print("Yes")
        else:
            print("No")
    elif flag == 1:
        if f(x[0], x[0], x[0]):
            print("Yes")
        else:
            print("No")
    else:
        if f(x[0], x[0], x[1]) or f(x[0], x[1], x[1]):
            print("Yes")
        else:
            print("No")





