def myAnswer(N:int,A:list) -> str:
   for n in range(N):
      if(n == 0):
         if(A[n+1] ^ A[-1] != A[n]):
            return "No"
      elif(n == N - 1):
         if(A[n-1] ^ A[0] != A[n]):
            return "No"
      elif(A[n - 1] ^ A[n + 1] != A[n]):
         return "No"
   return "Yes"

def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   print(myAnswer(N,A))
if __name__ == '__main__':
   main()