macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

use std::collections::HashMap;

fn main() {
    input!{
        n: usize,
        la: [usize; n]
    }
    let mut map: HashMap<usize, usize> = HashMap::new();
    for a in la {
        let value = map.entry(a).or_insert(0);
        *value += 1;
    }

    if map.len() == 2 || map.len() >= 4 {
        println!("No");
        return;
    }

    let mut keys = vec![];
    let mut values = vec![];
    for (key, val) in map.iter() {
        keys.push(*key);
        values.push(*val);
    }

    if map.len() == 1 {
        if keys[0] == 0 {
            println!("Yes");
        }else {
            println!("No");
        }
        return;
    }

    if values[0] != values[1] || values[1] != values[2] {
        println!("No");
        return;
    }
    if keys[0] ^ keys[1] == keys[2] {
        println!("Yes");
        return;
    }
    println!("No");
}
