import sys
s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2sss = lambda n: [list(sys.stdin.readline().rstrip()) for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

from collections import Counter

def main():
    N = i2n()
    A = i2nn()
    # 問題を数式化
    #   A[i-1] ^ A[i+1] = A[i] 
    # 移項する
    #   A[i-1] ^ A[i+1] - A[i] = 0
    #   A[i-1] ^ A[i+1] ^ A[i] = 0
    # 漸化式を考える
    #   A[i+1] = A[i-1] ^ A[i] 
    #   A[2] = A[0] ^ A[1] 
    # 漸化式をもう少し考える
    #   A[3] = A[1] ^ A[2] 
    #       A[1] ^ A[2] = A[0] なので
    #   A[3] = A[0]
    #   A[i+3] = A[i]
    # Nが3の倍数でないとき
    #   A[i] = A[j]
    #   A[i] ^ A[i+1] = A[i+2]
    #       A[i] = A[i+1] なので
    #   A[i+2] = 0
    #   よって, Aの要素は全てゼロ
    # Nが3の倍数のとき
    #   Counter, 要素数=3, カウント値は全て同じ
    c = Counter(A)
    if N % 3 != 0:
        if len(c) == 1 and 0 in c:
            print('Yes')
            return
    else:
        if len(c) == 3:
            k = list(c.keys())
            v = list(c.values())
            if k[0] ^ k[1] ^ k[2] == 0:
                if v[0] == v[1] and v[1] == v[2]:
                    print('Yes')
                    return
    print('No')

main()
