import sys

input = sys.stdin.readline


def main():
    n = int(input())
    a_list = [int(i) for i in input().split()]
    kind = set(a_list)
    # 0 0 0
    # 1 0 1 1 0 1
    # 1 2 3
    if len(kind) not in (1, 2, 3):
        print("No")
        return
    if len(kind) == 1 and 0 in kind:
        print("Yes")
        return
    if n % 3 != 0:
        return "No"
    if len(kind) == 3:
        if len(set([a_list.count(k) for k in kind])) != 1:
            print("No")
            return
        kind = list(kind)
        if kind[0] ^ kind[1] ^ kind[2] == 0:
            print("Yes")
        else:
            print("No")
    else:
        a, b = kind
        a_c, b_c = a_list.count(a), a_list.count(b)
        if 0 not in kind:
            print("No")
            return
        elif n / 3 != a_list.count(0):
            print("No")
        else:
            print("Yes")


if __name__ == "__main__":
    main()
