# -*- coding: utf-8 -*-

N = int(input())
a = list(map(int, input().split()))
tmp = set(a)
flag = True
if len(a) % 3 != 0 or len(tmp) != 3:
    flag = False
if flag:
    a = sorted(tmp)
    if not(a[0]^a[2] == a[1] and  a[1]^a[0] == a[2] and  a[2]^a[1] == a[0]):
        flag = False

if flag:
    print("Yes")
else:
    print("No")