import sys

input = sys.stdin.readline


def check(n, nums):
    kind = set(nums)

    if len(kind) not in (1, 2, 3):
        return False

    if len(kind) == 1 and 0 in kind:
        return True
    if n % 3 != 0:
        return False
    if len(kind) == 3:
        if len(set([nums.count(k) for k in kind])) != 1:
            return False
        kind = list(kind)
        if kind[0] ^ kind[1] ^ kind[2] == 0:
            return True
        else:
            return False
    else:
        a, b = kind
        a_c, b_c = nums.count(a), nums.count(b)
        if 0 not in kind:
            return False
        elif n / 3 != nums.count(0):
            return False
        else:
            return True


def main():
    n = int(input())
    a_list = [int(i) for i in input().split()]
    print("Yes" if check(n, a_list) else "No")


if __name__ == "__main__":
    main()
