from collections import deque
from sys import stdin

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

    a = deque(A)
    for _ in range(N):
        if a[0] ^ a[2] == a[1]:
            a.rotate()
        else:
            print('No')
            break
    else:
        print('Yes')

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