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

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("faild to read char") as char)
        .take_while(|c| !c.is_whitespace())
        .collect();
    token
        .parse()
        .ok()
        .expect("faild to parse token")
}

fn main(){
    let n: usize = read();
    let mut a: BTreeMap<u64, u64> = BTreeMap::new();

    for _ in 0..n {
        let b: u64 = read();

        match a.get_mut(&b) {
            Some(c) => {
                *c += 1;
            },
            None => {
                a.insert(b, 1);
            },
        }
    }
    
    let mut keys: Vec<u64> = a.keys().cloned().collect();
    keys.sort();

    if keys.len() == 1 && keys[0] == 0 {
        println!("Yes");
        return;
    } else if n % 3 != 0 {
        println!("No");
        return;
    } else if keys.len() == 2 {
        match a.get_mut(&0) {
            None => println!("No"),
            Some(b) => {
                if *b != (n / 3) as u64 {
                    println!("Yes");
                } else {
                    println!("No");
                }
            },
        }
        return;
    } else if keys.len() == 3 {
        let mut values: Vec<u64> = a.values().cloned().collect();
        values.sort();
        if values[0] != values[2] {
            println!("No");
            return;
        }
        if keys[0] ^ keys[1] ^ keys[2] == 0 {
            println!("Yes");
        } else {
            println!("No");
        }
        return;
    } else {
        println!("No");
    }
}
