def f(n, D, p, q):
    for i in range(n-2):
        r = p ^ q
        if (r in D) and (D[r] > 0):
            D[r] -= 1
        else:
            return -1
        p, q = q, r
    return p ^ q

def solve(n, a):
    D = {}
    for x in a:
        if not x in D:
            D[x] = 0
        D[x] += 1
    D[a[0]] -= 1
    for i in range(1, n):
        D[a[i]] -= 1
        ok = f(n, D.copy(), a[0], a[i]) == a[0]
        D[a[i]] += 1
        if ok:
            return "Yes"
    return "No"

n = int(input())
a = list(map(int, input().split()))
print(solve(n, a))