package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	defer flush()

	N := readInt()
	a := make([]int, N)
	for i := 0; i < N; i++ {
		a[i] = readInt()
	}

	c := map[int]int{}
	for i := 0; i < N; i++ {
		c[a[i]]++
	}

	for x := 0; x < N-1; x++ {
		for y := x + 1; y < N; y++ {
			t := map[int]int{}
			i, j := x, y
			t[i]++
			t[j]++
			for z := 0; z < N-2; z++ {
				k := i ^ j
				t[k]++
				if t[k] > c[k] {
					j = -1
					break
				}
				i, j = j, k
			}
			if j^x == y {
				println("Yes")
				return
			}
		}
	}
	println("No")
}

const (
	ioBufferSize = 1 * 1024 * 1024 // 1 MB
)

var stdinScanner = func() *bufio.Scanner {
	result := bufio.NewScanner(os.Stdin)
	result.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	result.Split(bufio.ScanWords)
	return result
}()

func readString() string {
	stdinScanner.Scan()
	return stdinScanner.Text()
}

func readInt() int {
	result, err := strconv.Atoi(readString())
	if err != nil {
		panic(err)
	}
	return result
}

var stdoutWriter = bufio.NewWriter(os.Stdout)

func flush() {
	stdoutWriter.Flush()
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdoutWriter, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdoutWriter, args...)
}
