use std::cmp::max;

fn main() {
    let mut n = String::new();
    std::io::stdin().read_line(&mut n).ok();
    let n: usize = n.trim().parse().unwrap();
    let mut a = String::new();
    std::io::stdin().read_line(&mut a).ok();
    let a: Vec<usize> = a.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();

    let mut result: usize = 0;
    for i in 0..n {
        for j in i..n {
            result = max(result, a[i] ^ a[j]);
        }
    }
    println!("{}", result);
}