#gcdは3.4.3だとfractionsにある
from fractions import gcd

from math import factorial as f

from math import ceil

from sys import exit

from copy import deepcopy

def main():


    n = int(input())
    a = list(map(int,input().split()))
    aunique = list(set(a))

    if len(aunique) == 1:
        if a[0] == 0:
            print("Yes")
        else:
            print("No")
    elif len(aunique) is 2:
        if n%3 or not 0 in aunique:
            print("No")
        else:
            l = []
            l.append(a.count(aunique[0]))
            l.append(a.count(aunique[1]))
            if aunique[0] == 0:
                if not l[0] == n//3:
                    print("No")
                else:
                    print("Yes")
            else:
                if not l[1] == n//3:
                    print("No")
                else:
                    print("Yes")
    elif len(aunique) is 3 and not n%3:
        l = []
        l.append(a.count(aunique[0]))
        l.append(a.count(aunique[1]))
        l.append(a.count(aunique[2]))

        if not l[0] is n//3 or not l[1] is n//3:
            print("No")
        else:
            if (aunique[0] ^ aunique[1]) ^ aunique[2] ==0:
                print("Yes")
            else:
                print("No")
    else:
        print("No")



main()