// https://atcoder.jp/contests/abc141/tasks/abc141_f
//
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

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

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! ifv {
    ($t:expr, $a:expr, $b: expr) => {
        if $t { $a } else { $b }
    }
}

#[allow(unused_macros)]
macro_rules! fill {
    ($t:expr, $v:expr) => {
        for i in 0..$t.len() {
            $t[i] = $v;
        }
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn row_basis(mut a: Vec<i64>) -> Vec<i64> {
    let n = a.len();
    let mut k = 0;
    for w in (0..60).rev() {
        let mask = 1<<w;
        for i in k..n {
            if a[i] & mask != mask {
                continue;
            }
            let mut tmp = a[k];
            a[k] = a[i];
            a[i] = tmp;
            for i in 0..n {
                if i != k {
                    if a[i] & mask == mask {
                        a[i] ^= a[k];
                    }
                }
            }
            k += 1;
            break;
        }
    }
    let mut basis = vec![];
    for i in 0..n {
        if a[i] >= 1 {
            basis.push(a[i]);
        }
    }
    basis
}

fn main() {
    input! {
        n: usize,
        a: [i64; n]
    };

    let mut a = a;
    let ok = true;
    let mut xor = 0;
    for i in 0..n {
        xor ^= a[i];
    }
    for i in 0..n {
        a[i] &= !xor;
    }

    let mut basis = row_basis(a);
    let mut total = 0;
    let mut flp = 0;

    for b in basis {
        flp = max(flp, flp^b);
    }

    for i in (0..60).rev() {
        let mask = 1<<i;
        if xor & mask == mask {
            total += mask;
        } else {
            if flp & mask == mask {
                total += mask * 2;
            }
        }
    }

    println!("{}", total);
}


Measured memory_bytes: 6396