# -*- coding: utf-8 -*-
def logic():
    N = int(input())
    alpha = list(map(int, input().split()))
    i = 0
    check = True
    while i < N:
      if i == 0:
        if not (alpha[N-1]^alpha[i+1]) == alpha[i]:
          check = False
          break
      elif i == N-1:
        if not (alpha[i-1]^alpha[0]) == alpha[i]:
          check = False
          break
      else :
        if not (alpha[i-1]^alpha[i+1]) == alpha[i]:
          check = False
          break
      i += 1
    if check:
      print("Yes")
    else:
      print("No")

if __name__ == '__main__':
    logic()