use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
use std::collections::HashMap;

#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let n: usize = read_as_vec()[0];
    let a: Vec<usize> = read_as_vec();

    if n == 3{
        if a[0] ^ a[1] == a[2]{
            println!("Yes");
        }else{
            println!("No");            
        }
        return;
    }

    if a.iter().all(|x| *x == 0){
        println!("Yes");
        return;
    }

    let mut hash: HashMap<usize, usize> = HashMap::new();

    for elem in a{
        *hash.entry(elem).or_insert(0) += 1;
    }

    //println!("{:?}", hash);

    if n%3 != 0 || hash.len() != 3 || hash.iter().any(|(_, value)| *value != n/3){
        println!("No");
        return;
    }

    let mut tmp: Vec<usize> = Vec::new();
    for key in hash.keys(){
        tmp.push(*key);
    }

    if tmp[0] ^ tmp[1] == tmp[2]{
        println!("Yes");
    }else{
        println!("No");
    }
    
    return;        
}
