import sys
import collections


def input():
    return sys.stdin.readline()[:-1]


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


if __name__ == "__main__":
    main()
