n = int(input())
a = list(map(int,input().split()))
if n%3 != 0:
    if a.count(0) == n:
        print("Yes")
    else:
        print("No")

    exit()

x,y,z = a[0],a[1],a[2]
if x^y != z:
    print("No")
else:
    for i in range(0,n,3):
        if x == a[i] and y == a[i+1] and z == a[i+2]:
            continue
        print("No")
        exit()
    print("Yes")