import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a = sorted(na())
x = [[0]*n for _ in range(30)]
 
if n%3:
    if max(a):
        print("No")
    else:
        print("Yes")
else:
    m = n//3
    if A[0] == A[m-1] and A[m] == A[2*m-1] and A[2*m] == A[3*m-1] and A[0]^A[m] == A[2*m]:
        print("Yes")
    else:
        print("No")