# from random import randint, shuffle, sample, choice

# def randil(a,b,n): return [ randint(a,b) for _ in range(n) ]  # list of N elements (a <= n <= b)
from itertools import permutations


# # n = int(input())
# n = 4

# for i in range(100):
#     al = randil(1,10,6)
    # ll = list(range(0,n))  # list of elements
    # perml = list(permutations(ll, n))
    # for perm in perml:
    #     for i in range(n):
    #         prev = al[perm[i-2]]
    #         curr = al[perm[i-1]]
    #         nextv = al[perm[i]]
    #         if prev^nextv != curr:
    #             break
    #     else:
    #         ans = []
    #         for i in range(n): 
    #             ans.append(al[perm[i]])
    #         print(ans)


n = int(input())
al = list(map(int, input().split()))

if n >3:
    print('No')
else:
    ll = list(range(0,n))  # list of elements
    perml = list(permutations(ll, n))
    for perm in perml:
        for i in range(n):
            prev = al[perm[i-2]]
            curr = al[perm[i-1]]
            nextv = al[perm[i]]
            if prev^nextv != curr:
                break
        else:
            print('Yes')
            exit()
    else:
        print('No')