from sys import stdin
from collections import defaultdict
def main():
    n = int(stdin.readline())
    a = map(int, stdin.readline().split())
    d = defaultdict(int)
    for x in a:
        d[x] += 1
    s = d.keys()
    if len(s) == 1:
        print 'Yes' if s[0] == 0 else 'No'
    elif len(s) == 2:
        print 'Yes' if (0 in s and n % 3 == 0 and d[0] == n / 3) else 'No'
    elif len(s) == 3:
        print 'Yes' if (s[0] ^ s[1] ^ s[2] == 0 and d[s[0]] == d[s[1]] == d[s[2]]) else 'No'
    else:
        print 'No'
main()
