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)
    if (len(c) != 3) or (n % 3 != 0):
        print("No")
    else:
        s = list(c.keys())
        v = list(c.values())
        if (s[0] == s[1] ^ s[2]) and (s[1] == s[2] ^ s[0]) and (s[2] == s[0] ^ s[1]) and (v[0] == v[1] == v[2]):
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    main()
