#!/usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
l = [int(i) for i in input().split()]
l.sort()

lset = set(l)

if len(lset) == 1:
    if l[0] == 0:
        print("Yes")
    else:
        print("No")

elif len(l)%3 == 0:
    if len(lset) == 2:
        k = list(lset)
        if k[0]^k[1] == k[1] and l[int(N/3)] == k[1]:
            print("Yes")
        else:
            print("No")
    
    elif len(lset) == 3:
        k = list(lset)
        if k[0]^k[1] == k[2] or k[0]^k[2] == k[1]:
            if l[int(N/3)] == k[1] and l[int(2*N/3)] == k[2]:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    
else:
    print("No")