program main
  implicit none
  integer(8) i, N, ans, A1,B,C,x
  integer(8), allocatable :: a(:)
  !read(*, *) (L(i), i = 1,N)
  read(*, *) N
  allocate(a(N))
  read(*, *) (a(i), i = 1,N)
  ans = 0
  !すべて0
  if (sum(a) == 0) then
    ans = 1
  end if
  !その他
  if (mod(N,3) == 0) then
    call qsort(a)
    if (a(1)==a(N/3)) then
      if (a(N/3+1)==a(2*N/3)) then
        if (a(2*N/3+1)==a(N)) then
          A1 = a(1)
          B = a(N/3+1)
          C = a(2*N/3+1)
          x = ieor(A1,B)          
          x = ieor(x,C)
          if (x == 0) then
            ans = 1
          end if
        end if
      end if
    end if
  end if
  if (ans == 0) then
    write(*, *) 'No'
  else
    write(*, *) 'Yes'
  end if

contains
 
  recursive subroutine qsort(a)
    implicit none
    integer(8),intent(inout) :: a(:)
    integer(8)::i,j,toobig,toosmall,pv,n
    n = size(a)
    i = 1
    j = n
    pv = a((i+j)/2)
    do
       do
         if (a(i) < pv) then
           i = i+1
         else
           exit
         end if
       end do
       do
         if(a(j) > pv) then
           j = j-1
         else
           exit
         end if
       end do
       if (i>=j) then
         exit
       else
         toobig = a(j)
         toosmall = a(i)
         a(i) = toobig
         a(j) = toosmall
         i = i+1
         j = j-1
       end if
     end do
     if (i > 2) then
       call qsort(a(1:i-1))
     end if
     if (j < n-1) then
       call qsort(a(j+1:n))
     end if
  end subroutine qsort
end program main
