macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    get!($($t),*)
        ).collect::<Vec<_>>()
    };
    ($t:ty |) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty | $n:expr) => {
        (0..$n).map(|_| get!($t |)).collect::<Vec<_>>()
    };
}

fn main() {
    let N = get!(usize);
    let As = get!(u64 |);
    let mut Aset: std::collections::HashMap<u64, usize> = std::collections::HashMap::new();
    for a in As.clone() {
        let mut n = 0;
        if let Some(N) = Aset.get(&a) {
            n = *N;
        }
        Aset.insert(a, n+1);
    }

    for i in 1..N {
        let mut zero = As[0];
        let mut Aset = Aset.clone();
        if Aset.get(&zero) == Some(&1) {
            Aset.remove(&zero);
        } else {
            let n = *Aset.get(&zero).expect("C");
            Aset.insert(zero, n-1);
        }

        let mut one = As[i];
        if Aset.get(&one) == Some(&1) {
            Aset.remove(&one);
        } else {
            let n = *Aset.get(&one).expect("B");
            Aset.insert(one, n-1);
        }

        while Aset.len() > 0 {
            let mut flg = false;
            for a in Aset.keys() {
                if zero ^ one == *a {
                    zero = one;
                    one = *a;
                    flg = true;
                    break;
                }
            }
            if !flg {
                break;
            }
            if Aset.get(&one) == Some(&1) {
                Aset.remove(&one);
            } else {
                let n = *Aset.get(&one).expect("A");
                Aset.insert(one, n-1);
            }
        }
        if Aset.len() == 0 {
            if zero ^ one == As[0] {
                println!("Yes");
                return;
            }
        }
    }
    println!("No");
}
