from fractions import gcd
# from datetime import date, timedelta
from heapq import*
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import fractions
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
# input = sys.stdin.readline


def main():
    n = int(input())
    a = list(map(int, input().split()))
    c = Counter(a)
    ans = [0] * n
    ans[0] = a[0]
    ans[1] = a[1]
    c[a[0]] -= 1
    c[a[1]] -= 1
    for i in range(2, n):
        v = ans[i - 1] ^ ans[i - 2]
        if c[v] > 0:
            ans[i] = v
            c[v] -= 1
        else:
            print("No")
            exit()
    for i in range(1, n - 1):
        if ans[i] != ans[i - 1] ^ ans[i + 1]:
            print("No")
            exit()
    if ans[n - 1] == ans[n - 2]^ans[0] and ans[0] == ans[1]^ans[n-1]:
        print("Yes")
    else:
        print("No")

            
    


if __name__ == '__main__':
    main()
