n = int(input())
line = list(map(int,input().split( )))
s = list(set(line))

if n%3==0 and 0 in line and line.count(0)==n//3 and len(s)<=2:
    print('Yes')
elif  n%3==0 and len(s)==3 and s[0]^s[1]==s[2] and s[1]^s[2]==s[0] and line.count(s[0])==n//3 and line.count(s[1])==n//3:
    print('Yes')
else:
    print('No')
