// Try AtCoder
// author: Leonardone @ NEETSDKASU

fn main() {
    let mut stdin = String::new();
    std::io::Read::read_to_string(
        &mut std::io::stdin(),
        &mut stdin).unwrap();
    let mut stdin = stdin.split_whitespace();
    let mut get = || stdin.next().unwrap();
    macro_rules! get {
        ($t:ty) => (get().parse::<$t>().unwrap());
        () => (get!(i64));
    }
    
    let n = get!(usize);
    let mut mp = std::collections::BTreeMap::new();
    let mut vs = vec![];
    let mut cs = vec![0; n];
    let mut ci = 0;
    for _ in 0 .. n {
    	let a = get!();
        if let Some(&i) = mp.get(&a) {
            cs[i] += 1;
            continue;
        }
        vs.push(a);
        mp.insert(a, ci);
        cs[ci] = 1;
        ci += 1;
    }
    if ci > 3 {
        println!("No");
        return;
    }
    let p0 = vs[0];

        let p1 = vs[1];
        let mut rs = vec![0; n];
        if let Some(&i) = mp.get(&p0) {
            rs[i] += 1;
        }
        if let Some(&i) = mp.get(&p1) {
            rs[i] += 1;
        }
        let mut pa = p0;
        let mut pb = p1;
        let mut ok = true;
        for _ in 2 .. n {
            let p = pa ^ pb;
            if let Some(&i) = mp.get(&p) {
                if rs[i] < cs[i] {
                    rs[i] += 1;
                } else {
                    ok = false;
                    break;
                }
            } else {
                ok = false;
                break;
            }
            pa = pb;
            pb = p;
        }
        if pa ^ pb != p0 {
            ok = false;
        }
        if pb ^ p0 != p1 {
            ok = false;
        }
        if ok {
            println!("Yes");
            return;
        }
    println!("No");
}
