package main

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

func main() {
	var n int
	fmt.Scan(&n)
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	m := make(map[int]int)
	for i := 0; i < n; i++ {
		sc.Scan()
		x, _ := strconv.Atoi(sc.Text())
		m[x]++
	}

	switch len(m) {
	case 1:
		if _, ok := m[0]; ok {
			fmt.Println("Yes")
			return
		}
	case 2:
		for k, v := range m {
			if k == 0 && v != n/3 {
				fmt.Println("No")
				return
			}
			if k != 0 && v != n*2/3 {
				fmt.Println("No")
				return
			}
		}
		fmt.Println("Yes")
	case 3:
		x := make([]int, 0, 3)
		for k, v := range m {
			if v != n/3 {
				fmt.Println("No")
				return
			}
			x = append(x, k)
		}
		if x[0]^x[1]^x[2] == 0 {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}
