let a=Int(readLine()!)!
var arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

arr.append(arr[0])

var no = 0

var x = 0
var y = 0

for i in 0..<a  {
  x = i - 1
  if( i == 0 ) {
    x = a - 1
  }
  y = i + 1
  if( ( arr[x] ^ arr[y] ) != arr[i] ) {
    no = 1
    break
  }
}

if( no != 1 ) {
	print("Yes")
} else {
	print("No")
}