use std::collections::BTreeMap;
use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let n: usize = read();
    let a: Vec<u64> = (0..n).map(|_| read()).collect();

    let mut map = BTreeMap::new();

    for &a_i in a.iter() {
        *map.entry(a_i).or_insert(0) += 1;
    }

    let ans = if a.iter().all(|&x| x == 0) {
        "Yes"
    } else if a.len() % 3 == 0 {
        match map.len() {
            2 => match map.get(&0) {
                Some(x) if *x == 2 * n / 3 => "Yes",
                _ => "No",
            },
            3 => {
                let key_value: Vec<_> = map.iter().collect();
                if key_value[0].0 ^ key_value[1].0 ^ key_value[2].0 == 0
                    && key_value.iter().all(|x| *x.1 == n / 3)
                {
                    "Yes"
                } else {
                    "No"
                }
            }
            _ => "No",
        }
    } else {
        "No"
    };
    println!("{}", ans);
}

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}
