from collections import Counter
from sys import stdin

def main():
    N = int(input())
    A = map(int, input().split())

    cnt = Counter(A).most_common()
    n = N // 3
    l = len(cnt)
    if cnt[0][0] == 0 and l == 1:
        print('Yes')
        return
    if cnt[1][0] == 0 and cnt[1][1] == n and l == 2:
        print('Yes')
        return
    if N % 3:
        print('No')
        return

    if cnt[0][0] ^ cnt[1][0] == cnt[2][0] and cnt[0][1] == cnt[1][1] == n:
        print('Yes')
    else:
        print('No')

input = lambda: stdin.readline()
main()
