import sys
input = sys.stdin.readline

def main():
    N = int(input())
    A = list(map(int, input().split()))
    zero_count = 0
    ok = False
    dic = {}
    for a in A:
        if a == 0:
            zero_count += 1
        else:
            if a in dic:
                dic[a] += 1
            else:
                dic[a] = 1
    # print(dic, zero_count)
    if len(dic) == 3:
        if zero_count == 0:
            tmp = list(dic.values())
            # print(tmp)
            if tmp[0] == tmp[1] and tmp[1] == tmp[2]:
                key = list(dic.keys())
                tmp = key[0]
                tmp ^= key[1]
                tmp ^= key[2]
                if tmp == 0:
                    print("Yes")
                    return
    if len(dic) == 1:
        if n%3 == 0:
            if zero_count == N/3:
                print("Yes")
                return
    if zero_count == N:
        print("Yes")
        return
    print("No")




if __name__ == "__main__":
    main()
