import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy


if __name__ == "__main__":
    n = int(input())
    a = list(map(int,input().split()))
    b = a[0]
    for i in range(n-1):
        b = b^a[i]
    for i in range(n):
        if a[i]^a[i-2] != a[i-1]:
            print("No")
            sys.exit()
    print("Yes")