import sys
import collections


input = sys.stdin.readline


def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    c = collections.Counter(a)
    s = list(c.keys())
    v = list(c.values())
    if (len(c) == 3) and (s[0] == s[1] ^ s[2]) and (v[0] == v[1] == v[2]):
        print("Yes")
    elif len(c) == 1 and s[0] == 0:
        print("Yes")
    elif len(c) == 2 and 0 in s and (c[0] == n/3*2):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
