import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.*;

public class Solver {

	public static void main(String[] Args) throws NumberFormatException,
			IOException {
		new Solver().Run();
	}

	PrintWriter pw;
	StringTokenizer Stok;
	BufferedReader br;

	public String nextToken() throws IOException {
		while (Stok == null || !Stok.hasMoreTokens()) {
			Stok = new StringTokenizer(br.readLine());
		}
		return Stok.nextToken();
	}

	public int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}

	public long nextLong() throws NumberFormatException, IOException {
		return Long.parseLong(nextToken());
	}

	final int KOL_BITS=41;

	int n;
	long[] a;
	long result=0;
	TrieTree tree;

	class Node{

		Node zero;
		Node one;

		public Node(){
			zero=null;
			one=null;
		}

	}

	class TrieTree{

		Node root;

		public TrieTree(){
			root=new Node();
		}

		public void addLong(long zn){
			StringBuilder sb=new StringBuilder(Long.toBinaryString(zn));
			int len=sb.length();
			for (int i=0; i<KOL_BITS-len; i++){
				sb.insert(0, '0');
			}
			Node curNode=root;
			for (int i=0; i<KOL_BITS; i++){
				if (sb.charAt(i)=='0'){
					if (curNode.zero==null)
						curNode.zero=new Node();
					curNode=curNode.zero;
				}
				else
				{
					if (curNode.one==null)
						curNode.one=new Node();
					curNode=curNode.one;
				}
			}
		}

		public long getMaxZn(long zn){
			int[] dig=new int[KOL_BITS];
			int[] digZn=new int[KOL_BITS];
			for (int i=KOL_BITS-1; i>=0; i--){
				digZn[i]=(int) (zn & 1);
				zn=(zn>>1);
			}

			Node curNode=root;
			int prefDig;
			long result=0;
			for (int i=0; i<KOL_BITS; i++){
				prefDig=1-digZn[i];
				if (prefDig==0){
					if (curNode.zero!=null){
						dig[i]=1;
						curNode=curNode.zero;
					}
					else
					{
						dig[i]=0;
						curNode=curNode.one;
					}
				}
				else
				{
					if (curNode.one!=null){
						dig[i]=1;
						curNode=curNode.one;
					}
					else
					{
						dig[i]=0;
						curNode=curNode.zero;
					}
				}
				result=(result<<1)|dig[i];
			}

			return result;
		}
	}

	public void genInput() throws FileNotFoundException{
		PrintWriter pw2=new PrintWriter("input.txt");
		pw2.println(100000);
		Random rn=new Random();
		for (int i=0; i<100000; i++){
			pw2.print(Math.abs(rn.nextLong() % (long)1e12));
			pw2.print(' ');
		}
		pw2.flush();
		pw2.close();
	}

	public void Run() throws NumberFormatException, IOException {
		//genInput();
		//return;
		//br = new BufferedReader(new FileReader("input.txt")); pw = new PrintWriter("output.txt");
		br=new BufferedReader(new InputStreamReader(System.in));  pw=new PrintWriter(new OutputStreamWriter(System.out));
		n=nextInt();
		a=new long[n];
		Random rn=new Random();
		for (int i=0; i<n; i++){
			a[i]=nextLong();
		}

		long curZn=0;
		tree=new TrieTree();
		tree.addLong(curZn);
		for (int i=n-1; i>=0; i--){
			curZn=(curZn ^ a[i]);
			tree.addLong(curZn);
		}

		curZn=0;
		result=tree.getMaxZn(curZn);
		long curres;
		for (int i=0; i<n; i++){
			curZn=(curZn ^ a[i]);
			curres=tree.getMaxZn(curZn);
			if (curres>result)
				result=curres;
		}
		pw.println(result);
		pw.flush();
		pw.close();
	}

}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.*;

public class Solver {

	public static void main(String[] Args) throws NumberFormatException,
			IOException {
		new Solver().Run();
	}

	PrintWriter pw;
	StringTokenizer Stok;
	BufferedReader br;

	public String nextToken() throws IOException {
		while (Stok == null || !Stok.hasMoreTokens()) {
			Stok = new StringTokenizer(br.readLine());
		}
		return Stok.nextToken();
	}

	public int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}

	public long nextLong() throws NumberFormatException, IOException {
		return Long.parseLong(nextToken());
	}

	final int KOL_BITS=41;

	int n;
	long[] a;
	long result=0;
	TrieTree tree;

	class Node{

		Node[] next;

		public Node(){
			next=new Node[2];
			next[0]=null;
			next[1]=null;
		}

	}

	class TrieTree{

		Node root;

		public TrieTree(){
			root=new Node();
		}

		public void addLong(long zn){
			StringBuilder sb=new StringBuilder(Long.toBinaryString(zn));
			int len=sb.length();
			for (int i=0; i<KOL_BITS-len; i++){
				sb.insert(0, '0');
			}
			Node curNode=root;
			for (int i=0; i<KOL_BITS; i++){
				if (sb.charAt(i)=='0'){
					if (curNode.next[0]==null)
						curNode.next[0]=new Node();
					curNode=curNode.next[0];
				}
				else
				{
					if (curNode.next[1]==null)
						curNode.next[1]=new Node();
					curNode=curNode.next[1];
				}
			}
		}

		public long getMaxZn(long zn){
			int[] dig=new int[KOL_BITS];
			int[] digZn=new int[KOL_BITS];
			for (int i=KOL_BITS-1; i>=0; i--){
				digZn[i]=(int) (zn & 1);
				zn=(zn>>1);
			}

			Node curNode=root;
			int prefDig;
			long result=0;
			for (int i=0; i<KOL_BITS; i++){
				prefDig=1-digZn[i];
				if (curNode.next[prefDig]!=null){
					dig[i]=1;
					curNode=curNode.next[prefDig];
				}
				else
				{
					dig[i]=0;
					curNode=curNode.next[1-prefDig];
				}
				result=(result<<1)|dig[i];
			}

			return result;
		}
	}

	public void genInput() throws FileNotFoundException{
		PrintWriter pw2=new PrintWriter("input.txt");
		pw2.println(100000);
		Random rn=new Random();
		for (int i=0; i<100000; i++){
			pw2.print(Math.abs(rn.nextLong() % (long)1e12));
			pw2.print(' ');
		}
		pw2.flush();
		pw2.close();
	}

	public void Run() throws NumberFormatException, IOException {
		//genInput();
		//return;
		//br = new BufferedReader(new FileReader("input.txt")); pw = new PrintWriter("output.txt");
		br=new BufferedReader(new InputStreamReader(System.in));  pw=new PrintWriter(new OutputStreamWriter(System.out));
		n=nextInt();
		a=new long[n];
		Random rn=new Random();
		for (int i=0; i<n; i++){
			a[i]=nextLong();
		}

		long curZn=0;
		tree=new TrieTree();
		tree.addLong(curZn);
		for (int i=n-1; i>=0; i--){
			curZn=(curZn ^ a[i]);
			tree.addLong(curZn);
		}

		curZn=0;
		result=tree.getMaxZn(curZn);
		long curres;
		for (int i=0; i<n; i++){
			curZn=(curZn ^ a[i]);
			curres=tree.getMaxZn(curZn);
			if (curres>result)
				result=curres;
		}
		pw.println(result);
		pw.flush();
		pw.close();
	}

}


import static java.lang.Math.*;
import java.util.*;
import java.io.*;

public class Sausage{

    static long xors [];
    static long all;

    public static void main(String [] argv) {
        Kattio io = new Kattio(System.in, System.out);
        int n = io.getInt();
        long A []  = new long [n];
        long xor = 0;
        for (int i=0; i<n; i++)
            A[i] = io.getLong();
        xors = new long [n];
        for (int i=0; i<n; i++) {
            xor ^= A[i];
            xors[i] = xor;
        }
        all = xor;

        long mx = all;
        for (int i=0; i<n; i++) {
            for (int j=i; j<n; j++) {
                mx = max(mx, xor( i, j));

            }
        }
        io.println(mx);
        io.close();
    }

    // all ^ (xor of A[i] .. A[j]) inclusive
    static long xor(int i, int j) {
        if (i==0) return all^xors[j];
        else return all^xors[j]^xors[i-1];
    }

}

// ########## KATTIO ////############
 class Kattio extends PrintWriter {
    public Kattio(InputStream i) {
        super(new BufferedOutputStream(System.out));
        r = new BufferedReader(new InputStreamReader(i));
    }
    public Kattio(InputStream i, OutputStream o) {
        super(new BufferedOutputStream(o));
        r = new BufferedReader(new InputStreamReader(i));
    }

    public boolean hasMoreTokens() {
        return peekToken() != null;
    }

    public int getInt() {
        return Integer.parseInt(nextToken());
    }

    public double getDouble() {
        return Double.parseDouble(nextToken());
    }

    public long getLong() {
        return Long.parseLong(nextToken());
    }

    public String getWord() {
        return nextToken();
    }

    private BufferedReader r;
    private String line;
    private StringTokenizer st;
    private String token;

    private String peekToken() {
        if (token == null)
            try {
                while (st == null || !st.hasMoreTokens()) {
                    line = r.readLine();
                    if (line == null) return null;
                    st = new StringTokenizer(line);
                }
                token = st.nextToken();
            } catch (IOException e) { }
        return token;
    }

    private String nextToken() {
        String ans = peekToken();
        token = null;
        return ans;
    }
}


import static java.lang.Math.*;
import java.util.*;
import java.io.*;

public class sausage {

    public static void main(String [] argv) {
        Kattio io = new Kattio(System.in, System.out);
        int n =io.getInt();
        long [] A = new long[n];
        long [] xors = new long[n+1];
        for (int i=0; i<n; i++) {
            A[i] = io.getLong();
            xors[i+1] = A[i]^xors[i];
        }
        long xorAll = xors[n];
        // now find max (XOR_{i=j}^{k} A[i]) XOR xorAll
        XorTrie2 xt2 = new XorTrie2();
        int d = 60;
        xt2.add(0, d);
        long best = xorAll;
        for (int j=0; j<n; j++) {
            best = max(best,
                       xt2.query(xorAll^xors[j+1], d));
            xt2.add(xors[j+1], d);
        }
        io.println(best);
        io.close();
    }
}

// @@@@@@@@@@@@@ KATTIO.JAVA
 class Kattio extends PrintWriter {
    public Kattio(InputStream i) {
        super(new BufferedOutputStream(System.out));
        r = new BufferedReader(new InputStreamReader(i));
    }
    public Kattio(InputStream i, OutputStream o) {
        super(new BufferedOutputStream(o));
        r = new BufferedReader(new InputStreamReader(i));
    }

    public boolean hasMoreTokens() {
        return peekToken() != null;
    }

    public int getInt() {
        return Integer.parseInt(nextToken());
    }

    public double getDouble() {
        return Double.parseDouble(nextToken());
    }

    public long getLong() {
        return Long.parseLong(nextToken());
    }

    public String getWord() {
        return nextToken();
    }

    private BufferedReader r;
    private String line;
    private StringTokenizer st;
    private String token;

    private String peekToken() {
        if (token == null)
            try {
                while (st == null || !st.hasMoreTokens()) {
                    line = r.readLine();
                    if (line == null) return null;
                    st = new StringTokenizer(line);
                }
                token = st.nextToken();
            } catch (IOException e) { }
        return token;
    }

    private String nextToken() {
        String ans = peekToken();
        token = null;
        return ans;
    }
}

// ################ XORTRIE2.JAVA @@@@@@@@@@@@@
class XorTrie2 {

    XorTrie2 [] n;

    // adds the 'mx' last bits of 'x' to the trie
    public void add(long x, int mx) {
        if (mx == 0) return;
        else {
            // you get the 'mx':th bit by (1<<(mx-1))
            int b = (x & (1L<<(mx-1))) == 0 ? 0 : 1;
            if (n == null) n = new XorTrie2[2];
            if (n[b] == null) n[b] = new XorTrie2();
            n[b].add(x, mx-1);
        }
    }

    // queries the trie for the
    // maximal possible (mx(x) ^ q)
    // among all 'x' in the trie
    // where mx(x) is the 'mx' least
    // significant bits of 'x'
    // (so, mx(x) = (1<<mx)-1)
    public long query(long q, int mx) {
        if (mx == 0) return 0;
        else {
            int b = (q&(1L<<(mx-1))) == 0 ? 1 : 0;
            if (n==null)  throw new Error("This should never happen!");
            else if (n[b] != null)     return (1L<<(mx-1)) | n[b].query(q, mx-1);
            else return n[b^1].query(q, mx-1);
        }
    }

    public static void main(String [] argv) {
        XorTrie2 xt = new XorTrie2();
        xt.add(0,3); // 000
        //xt.add(3,3); // 011
        xt.add(2,3); // 010
        xt.add(5,3); // 101

        //System.out.println("\n" + xt.query());
        //xt.add(9); //  1001
        //xt.add(12); // 1100
        //xt.add(1); //     1
        //xt.add(5);//    101
        System.out.println(xt.query(4, 3)); // 100
        //xt.add(2);
        //xt.add(7);

    }

}


import static java.lang.Math.*;
import java.util.*;
import java.io.*;

public class sausage {

    public static void main(String [] argv) {
        Kattio io = new Kattio(System.in, System.out);
        int n =io.getInt();
        long [] A = new long[n];
        long [] xors = new long[n+1];
        for (int i=0; i<n; i++) {
            A[i] = io.getInt();
            xors[i+1] = A[i]^xors[i];
        }
        long xorAll = xors[n];
        // now find max (XOR_{i=j}^{k} A[i]) XOR xorAll
        XorTrie2 xt2 = new XorTrie2();
        int d = 60;
        xt2.add(0, d);
        long best = xorAll;
        for (int j=0; j<n; j++) {
            best = max(best,
                       xt2.query(xorAll^xors[j+1], d));
            xt2.add(xors[j+1], d);
        }
        io.println(best);
        io.close();
    }
}

// @@@@@@@@@@@@@ KATTIO.JAVA
 class Kattio extends PrintWriter {
    public Kattio(InputStream i) {
        super(new BufferedOutputStream(System.out));
        r = new BufferedReader(new InputStreamReader(i));
    }
    public Kattio(InputStream i, OutputStream o) {
        super(new BufferedOutputStream(o));
        r = new BufferedReader(new InputStreamReader(i));
    }

    public boolean hasMoreTokens() {
        return peekToken() != null;
    }

    public int getInt() {
        return Integer.parseInt(nextToken());
    }

    public double getDouble() {
        return Double.parseDouble(nextToken());
    }

    public long getLong() {
        return Long.parseLong(nextToken());
    }

    public String getWord() {
        return nextToken();
    }

    private BufferedReader r;
    private String line;
    private StringTokenizer st;
    private String token;

    private String peekToken() {
        if (token == null)
            try {
                while (st == null || !st.hasMoreTokens()) {
                    line = r.readLine();
                    if (line == null) return null;
                    st = new StringTokenizer(line);
                }
                token = st.nextToken();
            } catch (IOException e) { }
        return token;
    }

    private String nextToken() {
        String ans = peekToken();
        token = null;
        return ans;
    }
}

// ################ XORTRIE2.JAVA @@@@@@@@@@@@@
class XorTrie2 {

    XorTrie2 [] n;

    // adds the 'mx' last bits of 'x' to the trie
    public void add(long x, int mx) {
        if (mx == 0) return;
        else {
            // you get the 'mx':th bit by (1<<(mx-1))
            int b = (x & (1L<<(mx-1))) == 0 ? 0 : 1;
            if (n == null) n = new XorTrie2[2];
            if (n[b] == null) n[b] = new XorTrie2();
            n[b].add(x, mx-1);
        }
    }

    // queries the trie for the
    // maximal possible (mx(x) ^ q)
    // among all 'x' in the trie
    // where mx(x) is the 'mx' least
    // significant bits of 'x'
    // (so, mx(x) = (1<<mx)-1)
    public long query(long q, int mx) {
        if (mx == 0) return 0;
        else {
            int b = (q&(1L<<(mx-1))) == 0 ? 1 : 0;
            if (n==null)  throw new Error("This should never happen!");
            else if (n[b] != null)     return (1L<<(mx-1)) | n[b].query(q, mx-1);
            else return n[b^1].query(q, mx-1);
        }
    }

    public static void main(String [] argv) {
        XorTrie2 xt = new XorTrie2();
        xt.add(0,3); // 000
        //xt.add(3,3); // 011
        xt.add(2,3); // 010
        xt.add(5,3); // 101

        //System.out.println("\n" + xt.query());
        //xt.add(9); //  1001
        //xt.add(12); // 1100
        //xt.add(1); //     1
        //xt.add(5);//    101
        System.out.println(xt.query(4, 3)); // 100
        //xt.add(2);
        //xt.add(7);

    }

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 *
 * @author pttrung
 */
public class E_Round_173_Div2 {

	public static long MOD = 1000000007;

	public static void main(String[] args) throws FileNotFoundException {
		// PrintWriter out = new PrintWriter(new FileOutputStream(new File(
		// "output.txt")));
		PrintWriter out = new PrintWriter(System.out);
		Scanner in = new Scanner();
		int n = in.nextInt();
		long[] data = new long[n];
		long[] post = new long[n];
		for (int i = 0; i < n; i++) {
			data[i] = in.nextLong();
		}
		long result = 0;
		Node root = new Node(40, 0);
		for (int i = n - 1; i >= 0; i--) {
			post[i] = data[i];
			if (i + 1 < n) {
				post[i] ^= post[i + 1];
			}
			if (result < post[i]) {
				result = post[i];
			}
			insert(post[i], root);

		}
		long pre = 0;

		for (int i = 0; i < n - 1; i++) {
			pre ^= data[i];
			// System.out.println(Long.toBinaryString(pre) + " " + pre);

			remove(post[i], root);
			long v = getMax(pre, root);
			if (v < pre) {
				v = pre;
			}
			if (v > result) {
				result = v;
			}

		}
		out.println(result);

		out.close();
	}

	static long getMax(long val, Node node) {
		int bit = ((1L << node.bit) & val) == 0 ? 0 : 1;
		if(bit == 1 && node.val == 1){
			val ^= (1L<<node.bit);
		}else if(node.val == 1){
			val  |= (1L<<node.bit);
		}
		if (node.bit == 0) {
			return  node.val;
		}
		long result;
		bit = ((1L << (node.bit - 1)) & val) == 0 ? 0 : 1;

		if (bit == 0) {
			if (node.right != null && node.right.count > 0) {
				result = getMax(val, node.right);
			} else if(node.left != null && node.left.count > 0){
				result = getMax(val, node.left);
			}else{
				result = val;
			}
		} else {
			if (node.left != null && node.left.count > 0) {
				result = getMax(val, node.left);
			} else if(node.right != null && node.right.count > 0){
				result = getMax(val, node.right);
			}else{
				result = val;
			}
		}
		return result;

	}

	static void remove(long val, Node node) {
		node.count--;
		if (node.bit == 0) {
			return;
		}
		long nxt = val & (1L << (node.bit - 1));
		if (nxt != 0) {
			remove(val, node.right);
		} else {
			remove(val, node.left);
		}
	}

	static void insert(long val, Node node) {
		node.count++;
		if (node.bit == 0) {

			return;
		}
		long nxt = val & (1L << (node.bit - 1));
		if (nxt != 0) {
			if (node.right == null) {
				node.right = new Node(node.bit - 1, 1);
			}
			insert(val, node.right);
		} else {
			if (node.left == null) {
				node.left = new Node(node.bit - 1, 0);
			}
			insert(val, node.left);
		}
	}

	static class Node {
		int bit;
		int val;
		int count;
		Node left, right;

		public Node(int bit, int val) {
			super();
			this.bit = bit;
			this.val = val;
		}

	}

	public static int[] KMP(String val) {
		int i = 0;
		int j = -1;
		int[] result = new int[val.length() + 1];
		result[0] = -1;
		while (i < val.length()) {
			while (j >= 0 && val.charAt(j) != val.charAt(i)) {
				j = result[j];
			}
			j++;
			i++;
			result[i] = j;
		}
		return result;

	}

	public static boolean nextPer(int[] data) {
		int i = data.length - 1;
		while (i > 0 && data[i] < data[i - 1]) {
			i--;
		}
		if (i == 0) {
			return false;
		}
		int j = data.length - 1;
		while (data[j] < data[i - 1]) {
			j--;
		}
		int temp = data[i - 1];
		data[i - 1] = data[j];
		data[j] = temp;
		Arrays.sort(data, i, data.length);
		return true;
	}

	public static int digit(long n) {
		int result = 0;
		while (n > 0) {
			n /= 10;
			result++;
		}
		return result;
	}

	public static double dist(long a, long b, long x, long y) {
		double val = (b - a) * (b - a) + (x - y) * (x - y);
		val = Math.sqrt(val);
		double other = x * x + a * a;
		other = Math.sqrt(other);
		return val + other;

	}

	public static class Point implements Comparable<Point> {

		int x, y;

		public Point(int start, int end) {
			this.x = start;
			this.y = end;
		}

		@Override
		public int hashCode() {
			int hash = 5;
			hash = 47 * hash + this.x;
			hash = 47 * hash + this.y;
			return hash;
		}

		@Override
		public boolean equals(Object obj) {
			if (obj == null) {
				return false;
			}
			if (getClass() != obj.getClass()) {
				return false;
			}
			final Point other = (Point) obj;
			if (this.x != other.x) {
				return false;
			}
			if (this.y != other.y) {
				return false;
			}
			return true;
		}

		@Override
		public int compareTo(Point o) {
			return x - o.x;
		}
	}

	public static class FT {

		long[] data;

		FT(int n) {
			data = new long[n];
		}

		public void update(int index, long value) {
			while (index < data.length) {
				data[index] += value;
				index += (index & (-index));
			}
		}

		public long get(int index) {
			long result = 0;
			while (index > 0) {
				result += data[index];
				index -= (index & (-index));
			}
			return result;

		}
	}

	public static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	public static long pow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b == 1) {
			return a;
		}
		long val = pow(a, b / 2);
		if (b % 2 == 0) {
			return val * val % MOD;
		} else {
			return val * (val * a % MOD) % MOD;

		}
	}

	static class Scanner {

		BufferedReader br;
		StringTokenizer st;

		public Scanner() throws FileNotFoundException {
			// System.setOut(new PrintStream(new
			// BufferedOutputStream(System.out), true));
			br = new BufferedReader(new InputStreamReader(System.in));
			// br = new BufferedReader(new InputStreamReader(new
			// FileInputStream(new File("input.txt"))));
		}

		public String next() {

			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					throw new RuntimeException();
				}
			}
			return st.nextToken();
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			st = null;
			try {
				return br.readLine();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}

		public boolean endLine() {
			try {
				String next = br.readLine();
				while (next != null && next.trim().isEmpty()) {
					next = br.readLine();
				}
				if (next == null) {
					return true;
				}
				st = new StringTokenizer(next);
				return st.hasMoreTokens();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}
	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 *
 * @author pttrung
 */
public class E_Round_173_Div2 {

	public static long MOD = 1000000007;

	public static void main(String[] args) throws FileNotFoundException {
		// PrintWriter out = new PrintWriter(new FileOutputStream(new File(
		// "output.txt")));
		PrintWriter out = new PrintWriter(System.out);
		Scanner in = new Scanner();
		int n = in.nextInt();
		long[] data = new long[n];
		long[] post = new long[n];
		for (int i = 0; i < n; i++) {
			data[i] = in.nextLong();
		}
		long result = 0;
		Node root = new Node(45, 0);
		for (int i = n - 1; i >= 0; i--) {
			post[i] = data[i];
			if (i + 1 < n) {
				post[i] ^= post[i + 1];
			}
			if (result < post[i]) {
				result = post[i];
			}
			insert(post[i], root);

		}
		long pre = 0;

		for (int i = 0; i < n - 1; i++) {
			pre ^= data[i];
			// System.out.println(Long.toBinaryString(pre) + " " + pre);

			remove(post[i], root);
			long v = getMax(pre, root);
			if (v < pre) {
				v = pre;
			}
			if (v > result) {
				result = v;
			}

		}
		out.println(result);

		out.close();
	}

	static long getMax(long val, Node node) {
		int bit = ((1L << node.bit) & val) == 0 ? 0 : 1;
		if(bit == 1){
			val ^= (1L<<node.bit);
		}
		if (node.bit == 0) {
			return bit ^ node.val;
		}
		long result = ((long)(bit ^ node.val) )<< (node.bit);
		bit = ((1L << (node.bit - 1)) & val) == 0 ? 0 : 1;

		if (bit == 0) {
			if (node.right != null && node.right.count > 0) {
				result |= getMax(val, node.right);
			} else if(node.left != null && node.left.count > 0){
				result |= getMax(val, node.left);
			}else{
				result = val;
			}
		} else {
			if (node.left != null && node.left.count > 0) {
				result |= getMax(val, node.left);
			} else if(node.right != null && node.right.count > 0){
				result |= getMax(val, node.right);
			}else{
				result = val;
			}
		}
		return result;

	}

	static void remove(long val, Node node) {
		node.count--;
		if (node.bit == 0) {
			return;
		}
		long nxt = val & (1L << (node.bit - 1));
		if (nxt != 0) {
			remove(val, node.right);
		} else {
			remove(val, node.left);
		}
	}

	static void insert(long val, Node node) {
		node.count++;
		if (node.bit == 0) {

			return;
		}
		long nxt = val & (1L << (node.bit - 1));
		if (nxt != 0) {
			if (node.right == null) {
				node.right = new Node(node.bit - 1, 1);
			}
			insert(val, node.right);
		} else {
			if (node.left == null) {
				node.left = new Node(node.bit - 1, 0);
			}
			insert(val, node.left);
		}
	}

	static class Node {
		int bit;
		int val;
		int count;
		Node left, right;

		public Node(int bit, int val) {
			super();
			this.bit = bit;
			this.val = val;
		}

	}

	public static int[] KMP(String val) {
		int i = 0;
		int j = -1;
		int[] result = new int[val.length() + 1];
		result[0] = -1;
		while (i < val.length()) {
			while (j >= 0 && val.charAt(j) != val.charAt(i)) {
				j = result[j];
			}
			j++;
			i++;
			result[i] = j;
		}
		return result;

	}

	public static boolean nextPer(int[] data) {
		int i = data.length - 1;
		while (i > 0 && data[i] < data[i - 1]) {
			i--;
		}
		if (i == 0) {
			return false;
		}
		int j = data.length - 1;
		while (data[j] < data[i - 1]) {
			j--;
		}
		int temp = data[i - 1];
		data[i - 1] = data[j];
		data[j] = temp;
		Arrays.sort(data, i, data.length);
		return true;
	}

	public static int digit(long n) {
		int result = 0;
		while (n > 0) {
			n /= 10;
			result++;
		}
		return result;
	}

	public static double dist(long a, long b, long x, long y) {
		double val = (b - a) * (b - a) + (x - y) * (x - y);
		val = Math.sqrt(val);
		double other = x * x + a * a;
		other = Math.sqrt(other);
		return val + other;

	}

	public static class Point implements Comparable<Point> {

		int x, y;

		public Point(int start, int end) {
			this.x = start;
			this.y = end;
		}

		@Override
		public int hashCode() {
			int hash = 5;
			hash = 47 * hash + this.x;
			hash = 47 * hash + this.y;
			return hash;
		}

		@Override
		public boolean equals(Object obj) {
			if (obj == null) {
				return false;
			}
			if (getClass() != obj.getClass()) {
				return false;
			}
			final Point other = (Point) obj;
			if (this.x != other.x) {
				return false;
			}
			if (this.y != other.y) {
				return false;
			}
			return true;
		}

		@Override
		public int compareTo(Point o) {
			return x - o.x;
		}
	}

	public static class FT {

		long[] data;

		FT(int n) {
			data = new long[n];
		}

		public void update(int index, long value) {
			while (index < data.length) {
				data[index] += value;
				index += (index & (-index));
			}
		}

		public long get(int index) {
			long result = 0;
			while (index > 0) {
				result += data[index];
				index -= (index & (-index));
			}
			return result;

		}
	}

	public static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	public static long pow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b == 1) {
			return a;
		}
		long val = pow(a, b / 2);
		if (b % 2 == 0) {
			return val * val % MOD;
		} else {
			return val * (val * a % MOD) % MOD;

		}
	}

	static class Scanner {

		BufferedReader br;
		StringTokenizer st;

		public Scanner() throws FileNotFoundException {
			// System.setOut(new PrintStream(new
			// BufferedOutputStream(System.out), true));
			br = new BufferedReader(new InputStreamReader(System.in));
			// br = new BufferedReader(new InputStreamReader(new
			// FileInputStream(new File("input.txt"))));
		}

		public String next() {

			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					throw new RuntimeException();
				}
			}
			return st.nextToken();
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			st = null;
			try {
				return br.readLine();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}

		public boolean endLine() {
			try {
				String next = br.readLine();
				while (next != null && next.trim().isEmpty()) {
					next = br.readLine();
				}
				if (next == null) {
					return true;
				}
				st = new StringTokenizer(next);
				return st.hasMoreTokens();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}
	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 *
 * @author pttrung
 */
public class E_Round_173_Div2 {

	public static long MOD = 1000000007;

	public static void main(String[] args) throws FileNotFoundException {
		// PrintWriter out = new PrintWriter(new FileOutputStream(new File(
		// "output.txt")));
		PrintWriter out = new PrintWriter(System.out);
		Scanner in = new Scanner();
		int n = in.nextInt();
		long[] data = new long[n];
		long[] post = new long[n];
		for (int i = 0; i < n; i++) {
			data[i] = in.nextLong();
		}
		long result = 0;
		Node root = new Node(40, 0);
		for (int i = n - 1; i >= 0; i--) {
			post[i] = data[i];
			if (i + 1 < n) {
				post[i] ^= post[i + 1];
			}
			if (result < post[i]) {
				result = post[i];
			}
			insert(post[i], root);

		}
		long pre = 0;

		for (int i = 0; i < n - 1; i++) {
			pre ^= data[i];
			// System.out.println(Long.toBinaryString(pre) + " " + pre);

			remove(post[i], root);
			long v = getMax(pre, root);
			if (v < pre) {
				v = pre;
			}
			if (v > result) {
				result = v;
			}

		}
		out.println(result);

		out.close();
	}

	static long getMax(long val, Node node) {
		int bit = ((1L << node.bit) & val) == 0 ? 0 : 1;
		if(bit == 1){
			val ^= (1L<<node.bit);
		}
		if (node.bit == 0) {
			return bit ^ node.val;
		}
		long result = ((long)(bit ^ node.val) )<< (node.bit);
		bit = ((1L << (node.bit - 1)) & val) == 0 ? 0 : 1;

		if (bit == 0) {
			if (node.right != null && node.right.count > 0) {
				result |= getMax(val, node.right);
			} else if(node.left != null && node.left.count > 0){
				result |= getMax(val, node.left);
			}else{
				result = val;
			}
		} else {
			if (node.left != null && node.left.count > 0) {
				result |= getMax(val, node.left);
			} else if(node.right != null && node.right.count > 0){
				result |= getMax(val, node.right);
			}else{
				result = val;
			}
		}
		return result;

	}

	static void remove(long val, Node node) {
		node.count--;
		if (node.bit == 0) {
			return;
		}
		long nxt = val & (1L << (node.bit - 1));
		if (nxt != 0) {
			remove(val, node.right);
		} else {
			remove(val, node.left);
		}
	}

	static void insert(long val, Node node) {
		node.count++;
		if (node.bit == 0) {

			return;
		}
		long nxt = val & (1L << (node.bit - 1));
		if (nxt != 0) {
			if (node.right == null) {
				node.right = new Node(node.bit - 1, 1);
			}
			insert(val, node.right);
		} else {
			if (node.left == null) {
				node.left = new Node(node.bit - 1, 0);
			}
			insert(val, node.left);
		}
	}

	static class Node {
		int bit;
		int val;
		int count;
		Node left, right;

		public Node(int bit, int val) {
			super();
			this.bit = bit;
			this.val = val;
		}

	}

	public static int[] KMP(String val) {
		int i = 0;
		int j = -1;
		int[] result = new int[val.length() + 1];
		result[0] = -1;
		while (i < val.length()) {
			while (j >= 0 && val.charAt(j) != val.charAt(i)) {
				j = result[j];
			}
			j++;
			i++;
			result[i] = j;
		}
		return result;

	}

	public static boolean nextPer(int[] data) {
		int i = data.length - 1;
		while (i > 0 && data[i] < data[i - 1]) {
			i--;
		}
		if (i == 0) {
			return false;
		}
		int j = data.length - 1;
		while (data[j] < data[i - 1]) {
			j--;
		}
		int temp = data[i - 1];
		data[i - 1] = data[j];
		data[j] = temp;
		Arrays.sort(data, i, data.length);
		return true;
	}

	public static int digit(long n) {
		int result = 0;
		while (n > 0) {
			n /= 10;
			result++;
		}
		return result;
	}

	public static double dist(long a, long b, long x, long y) {
		double val = (b - a) * (b - a) + (x - y) * (x - y);
		val = Math.sqrt(val);
		double other = x * x + a * a;
		other = Math.sqrt(other);
		return val + other;

	}

	public static class Point implements Comparable<Point> {

		int x, y;

		public Point(int start, int end) {
			this.x = start;
			this.y = end;
		}

		@Override
		public int hashCode() {
			int hash = 5;
			hash = 47 * hash + this.x;
			hash = 47 * hash + this.y;
			return hash;
		}

		@Override
		public boolean equals(Object obj) {
			if (obj == null) {
				return false;
			}
			if (getClass() != obj.getClass()) {
				return false;
			}
			final Point other = (Point) obj;
			if (this.x != other.x) {
				return false;
			}
			if (this.y != other.y) {
				return false;
			}
			return true;
		}

		@Override
		public int compareTo(Point o) {
			return x - o.x;
		}
	}

	public static class FT {

		long[] data;

		FT(int n) {
			data = new long[n];
		}

		public void update(int index, long value) {
			while (index < data.length) {
				data[index] += value;
				index += (index & (-index));
			}
		}

		public long get(int index) {
			long result = 0;
			while (index > 0) {
				result += data[index];
				index -= (index & (-index));
			}
			return result;

		}
	}

	public static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	public static long pow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b == 1) {
			return a;
		}
		long val = pow(a, b / 2);
		if (b % 2 == 0) {
			return val * val % MOD;
		} else {
			return val * (val * a % MOD) % MOD;

		}
	}

	static class Scanner {

		BufferedReader br;
		StringTokenizer st;

		public Scanner() throws FileNotFoundException {
			// System.setOut(new PrintStream(new
			// BufferedOutputStream(System.out), true));
			br = new BufferedReader(new InputStreamReader(System.in));
			// br = new BufferedReader(new InputStreamReader(new
			// FileInputStream(new File("input.txt"))));
		}

		public String next() {

			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					throw new RuntimeException();
				}
			}
			return st.nextToken();
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			st = null;
			try {
				return br.readLine();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}

		public boolean endLine() {
			try {
				String next = br.readLine();
				while (next != null && next.trim().isEmpty()) {
					next = br.readLine();
				}
				if (next == null) {
					return true;
				}
				st = new StringTokenizer(next);
				return st.hasMoreTokens();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}
	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 *
 * @author pttrung
 */
public class E_Round_173_Div2 {

	public static long MOD = 1000000007;

	public static void main(String[] args) throws FileNotFoundException {
		// PrintWriter out = new PrintWriter(new FileOutputStream(new File(
		// "output.txt")));
		PrintWriter out = new PrintWriter(System.out);
		Scanner in = new Scanner();
		int n = in.nextInt();
		long[] data = new long[n];
		long[] post = new long[n];
		for (int i = 0; i < n; i++) {
			data[i] = in.nextLong();
		}
		long result = 0;
		Node root = new Node(40, 0);
		for (int i = n - 1; i >= 0; i--) {
			post[i] = data[i];
			if (i + 1 < n) {
				post[i] ^= post[i + 1];
			}
			if (result < post[i]) {
				result = post[i];
			}
			insert(post[i], root);

		}
		long pre = 0;

		for (int i = 0; i < n - 1; i++) {
			pre ^= data[i];
			// System.out.println(Long.toBinaryString(pre) + " " + pre);

			remove(post[i], root);
			long v = getMax(pre, root);
			if (v < pre) {
				v = pre;
			}
			if (v > result) {
				result = v;
			}

		}
		out.println(result);

		out.close();
	}

	static long getMax(long val, Node node) {
		int bit = ((1L << node.bit) & val) == 0 ? 0 : 1;
		if(bit == 1 && node.val == 1){
			val ^= (1L<<node.bit);
		}else if(node.val == 1){
			val  |= (1L<<node.bit);
		}
		if (node.bit == 0) {
			return  val;
		}
		long result;
		bit = ((1L << (node.bit - 1)) & val) == 0 ? 0 : 1;

		if (bit == 0) {
			if (node.right != null && node.right.count > 0) {
				result = getMax(val, node.right);
			} else if(node.left != null && node.left.count > 0){
				result = getMax(val, node.left);
			}else{
				result = val;
			}
		} else {
			if (node.left != null && node.left.count > 0) {
				result = getMax(val, node.left);
			} else if(node.right != null && node.right.count > 0){
				result = getMax(val, node.right);
			}else{
				result = val;
			}
		}
		return result;

	}

	static void remove(long val, Node node) {
		node.count--;
		if (node.bit == 0) {
			return;
		}
		long nxt = val & (1L << (node.bit - 1));
		if (nxt != 0) {
			remove(val, node.right);
		} else {
			remove(val, node.left);
		}
	}

	static void insert(long val, Node node) {
		node.count++;
		if (node.bit == 0) {

			return;
		}
		long nxt = val & (1L << (node.bit - 1));
		if (nxt != 0) {
			if (node.right == null) {
				node.right = new Node(node.bit - 1, 1);
			}
			insert(val, node.right);
		} else {
			if (node.left == null) {
				node.left = new Node(node.bit - 1, 0);
			}
			insert(val, node.left);
		}
	}

	static class Node {
		int bit;
		int val;
		int count;
		Node left, right;

		public Node(int bit, int val) {
			super();
			this.bit = bit;
			this.val = val;
		}

	}

	public static int[] KMP(String val) {
		int i = 0;
		int j = -1;
		int[] result = new int[val.length() + 1];
		result[0] = -1;
		while (i < val.length()) {
			while (j >= 0 && val.charAt(j) != val.charAt(i)) {
				j = result[j];
			}
			j++;
			i++;
			result[i] = j;
		}
		return result;

	}

	public static boolean nextPer(int[] data) {
		int i = data.length - 1;
		while (i > 0 && data[i] < data[i - 1]) {
			i--;
		}
		if (i == 0) {
			return false;
		}
		int j = data.length - 1;
		while (data[j] < data[i - 1]) {
			j--;
		}
		int temp = data[i - 1];
		data[i - 1] = data[j];
		data[j] = temp;
		Arrays.sort(data, i, data.length);
		return true;
	}

	public static int digit(long n) {
		int result = 0;
		while (n > 0) {
			n /= 10;
			result++;
		}
		return result;
	}

	public static double dist(long a, long b, long x, long y) {
		double val = (b - a) * (b - a) + (x - y) * (x - y);
		val = Math.sqrt(val);
		double other = x * x + a * a;
		other = Math.sqrt(other);
		return val + other;

	}

	public static class Point implements Comparable<Point> {

		int x, y;

		public Point(int start, int end) {
			this.x = start;
			this.y = end;
		}

		@Override
		public int hashCode() {
			int hash = 5;
			hash = 47 * hash + this.x;
			hash = 47 * hash + this.y;
			return hash;
		}

		@Override
		public boolean equals(Object obj) {
			if (obj == null) {
				return false;
			}
			if (getClass() != obj.getClass()) {
				return false;
			}
			final Point other = (Point) obj;
			if (this.x != other.x) {
				return false;
			}
			if (this.y != other.y) {
				return false;
			}
			return true;
		}

		@Override
		public int compareTo(Point o) {
			return x - o.x;
		}
	}

	public static class FT {

		long[] data;

		FT(int n) {
			data = new long[n];
		}

		public void update(int index, long value) {
			while (index < data.length) {
				data[index] += value;
				index += (index & (-index));
			}
		}

		public long get(int index) {
			long result = 0;
			while (index > 0) {
				result += data[index];
				index -= (index & (-index));
			}
			return result;

		}
	}

	public static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	public static long pow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b == 1) {
			return a;
		}
		long val = pow(a, b / 2);
		if (b % 2 == 0) {
			return val * val % MOD;
		} else {
			return val * (val * a % MOD) % MOD;

		}
	}

	static class Scanner {

		BufferedReader br;
		StringTokenizer st;

		public Scanner() throws FileNotFoundException {
			// System.setOut(new PrintStream(new
			// BufferedOutputStream(System.out), true));
			br = new BufferedReader(new InputStreamReader(System.in));
			// br = new BufferedReader(new InputStreamReader(new
			// FileInputStream(new File("input.txt"))));
		}

		public String next() {

			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					throw new RuntimeException();
				}
			}
			return st.nextToken();
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			st = null;
			try {
				return br.readLine();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}

		public boolean endLine() {
			try {
				String next = br.readLine();
				while (next != null && next.trim().isEmpty()) {
					next = br.readLine();
				}
				if (next == null) {
					return true;
				}
				st = new StringTokenizer(next);
				return st.hasMoreTokens();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}
	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 *
 * @author pttrung
 */
public class E_Round_173_Div2 {

	public static long MOD = 1000000007;
	static long re;

	public static void main(String[] args) throws FileNotFoundException {
		// PrintWriter out = new PrintWriter(new FileOutputStream(new File(
		// "output.txt")));
		PrintWriter out = new PrintWriter(System.out);
		Scanner in = new Scanner();
		int n = in.nextInt();
		long[] data = new long[n];
		long[] post = new long[n];
		for (int i = 0; i < n; i++) {
			data[i] = in.nextLong();
		}
		long result = 0;
		Node root = new Node(40, 0);
		for (int i = n - 1; i >= 0; i--) {
			post[i] = data[i];
			if (i + 1 < n) {
				post[i] ^= post[i + 1];
			}
			if (result < post[i]) {
				result = post[i];
			}
			insert(post[i], root);

		}
		long pre = 0;

		for (int i = 0; i < n - 1; i++) {
			pre ^= data[i];
			// System.out.println(Long.toBinaryString(pre) + " " + pre);

			remove(post[i], root);
			re = 0;
			getMax(pre, root);
			if (re < pre) {
				re = pre;
			}
			if (re > result) {
				result = re;
			}

		}
		out.println(result);

		out.close();
	}

	static void getMax(long val, Node node) {
		while (true) {
			int bit = ((1L << node.bit) & val) == 0 ? 0 : 1;
			if (bit == 1 && node.val == 1) {
				val ^= (1L << node.bit);
			} else if (node.val == 1) {
				val |= (1L << node.bit);
			}
			if (node.bit == 0) {
				re = val;
				return;
			}
			bit = ((1L << (node.bit - 1)) & val) == 0 ? 0 : 1;

			if (bit == 0) {
				if (node.right != null && node.right.count > 0) {
					node = node.right;
				} else if (node.left != null && node.left.count > 0) {
					node = node.left;
				} else {
					re = val;
				}
			} else {
				if (node.left != null && node.left.count > 0) {
					node = node.left;
				} else if (node.right != null && node.right.count > 0) {
					node = node.right;
				} else {
					re = val;
					break;
				}
			}
		}

	}

	static void remove(long val, Node node) {
		while (true) {
			node.count--;
			if (node.bit == 0) {
				return;
			}
			long nxt = val & (1L << (node.bit - 1));
			if (nxt != 0) {
				node = node.right;
			} else {
				node = node.left;
			}
		}
	}

	static void insert(long val, Node node) {
		while (true) {
			node.count++;
			if (node.bit == 0) {

				return;
			}
			long nxt = val & (1L << (node.bit - 1));
			if (nxt != 0) {
				if (node.right == null) {
					node.right = new Node(node.bit - 1, 1);
				}
				node = node.right;
			} else {
				if (node.left == null) {
					node.left = new Node(node.bit - 1, 0);
				}
				node = node.left;
			}
		}
	}

	static class Node {
		int bit;
		int val;
		int count;
		Node left, right;

		public Node(int bit, int val) {
			super();
			this.bit = bit;
			this.val = val;
		}

	}

	public static int[] KMP(String val) {
		int i = 0;
		int j = -1;
		int[] result = new int[val.length() + 1];
		result[0] = -1;
		while (i < val.length()) {
			while (j >= 0 && val.charAt(j) != val.charAt(i)) {
				j = result[j];
			}
			j++;
			i++;
			result[i] = j;
		}
		return result;

	}

	public static boolean nextPer(int[] data) {
		int i = data.length - 1;
		while (i > 0 && data[i] < data[i - 1]) {
			i--;
		}
		if (i == 0) {
			return false;
		}
		int j = data.length - 1;
		while (data[j] < data[i - 1]) {
			j--;
		}
		int temp = data[i - 1];
		data[i - 1] = data[j];
		data[j] = temp;
		Arrays.sort(data, i, data.length);
		return true;
	}

	public static int digit(long n) {
		int result = 0;
		while (n > 0) {
			n /= 10;
			result++;
		}
		return result;
	}

	public static double dist(long a, long b, long x, long y) {
		double val = (b - a) * (b - a) + (x - y) * (x - y);
		val = Math.sqrt(val);
		double other = x * x + a * a;
		other = Math.sqrt(other);
		return val + other;

	}

	public static class Point implements Comparable<Point> {

		int x, y;

		public Point(int start, int end) {
			this.x = start;
			this.y = end;
		}

		@Override
		public int hashCode() {
			int hash = 5;
			hash = 47 * hash + this.x;
			hash = 47 * hash + this.y;
			return hash;
		}

		@Override
		public boolean equals(Object obj) {
			if (obj == null) {
				return false;
			}
			if (getClass() != obj.getClass()) {
				return false;
			}
			final Point other = (Point) obj;
			if (this.x != other.x) {
				return false;
			}
			if (this.y != other.y) {
				return false;
			}
			return true;
		}

		@Override
		public int compareTo(Point o) {
			return x - o.x;
		}
	}

	public static class FT {

		long[] data;

		FT(int n) {
			data = new long[n];
		}

		public void update(int index, long value) {
			while (index < data.length) {
				data[index] += value;
				index += (index & (-index));
			}
		}

		public long get(int index) {
			long result = 0;
			while (index > 0) {
				result += data[index];
				index -= (index & (-index));
			}
			return result;

		}
	}

	public static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	public static long pow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b == 1) {
			return a;
		}
		long val = pow(a, b / 2);
		if (b % 2 == 0) {
			return val * val % MOD;
		} else {
			return val * (val * a % MOD) % MOD;

		}
	}

	static class Scanner {

		BufferedReader br;
		StringTokenizer st;

		public Scanner() throws FileNotFoundException {
			// System.setOut(new PrintStream(new
			// BufferedOutputStream(System.out), true));
			br = new BufferedReader(new InputStreamReader(System.in));
			// br = new BufferedReader(new InputStreamReader(new
			// FileInputStream(new File("input.txt"))));
		}

		public String next() {

			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					throw new RuntimeException();
				}
			}
			return st.nextToken();
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			st = null;
			try {
				return br.readLine();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}

		public boolean endLine() {
			try {
				String next = br.readLine();
				while (next != null && next.trim().isEmpty()) {
					next = br.readLine();
				}
				if (next == null) {
					return true;
				}
				st = new StringTokenizer(next);
				return st.hasMoreTokens();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}
	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 * @author pttrung
 */
public class E_Round_173_Div2 {

    public static long MOD = 1000000007;

    public static void main(String[] args) throws FileNotFoundException {
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File(
        // "output.txt")));
        PrintWriter out = new PrintWriter(System.out);
        Scanner in = new Scanner();
        int n = in.nextInt();
        long[]data = new long[n];
        long[]post = new long[n];
        for(int i = 0; i< n; i++){
        	data[i] = in.nextLong();
        }
        long result = 0;
        Node root = new Node(45,0);
        for(int i = n - 1; i >= 0; i--){
        	post[i] = data[i];
        	if(i + 1 < n){
        		post[i] ^= post[i + 1];
        	}
        	if(result < post[i]){
        		result = post[i];
        	}
        	insert(post[i], root);

        }
        long pre = 0;

        for(int i = 0; i < n - 1; i++){
        	pre ^= data[i];
        	//System.out.println(Long.toBinaryString(pre) + " " + pre);

        	remove(post[i], root);
        	long v = getMax(pre, root);
        	if(v < pre){
        		v = pre;
        	}
        	if(v > result){
        		result = v;
        	}

        }
        out.println(result );

        out.close();
    }
    static long getMax(long val, Node node){
    	int bit = ((1<< node.bit)& val) == 0 ? 0 : 1;
    	if(node.bit == 0){

    		return bit ^ node.val;
    	}
    	long result = (bit ^ node.val) << (node.bit);
    	bit = ((1<<(node.bit - 1)) & val) == 0 ? 0 : 1;

    	if(bit == 0){
    		if(node.right != null && node.right.count > 0){
    			result |= getMax(val, node.right);
    		}else{
    			result |= getMax(val, node.left);
    		}
    	}else{
    		if(node.left != null && node.left.count > 0){
    			result |= getMax(val, node.left);
    		}else{
    			result |= getMax(val, node.right);
    		}
    	}
    	return result;

    }

    static void remove(long val, Node node){
    	node.count--;
    	if(node.bit == 0){
    		return;
    	}
    	long nxt = val & (1<<(node.bit - 1));
    	if(nxt != 0){
    		remove(val, node.right);
    	}else{
    		remove(val, node.left);
    	}
    }
    static void insert(long val, Node node){
    	node.count++;
    	if(node.bit == 0){

    		return;
    	}
    	long nxt = val & (1<<(node.bit - 1));
    	if(nxt != 0){
    		if(node.right == null){
    			node.right = new Node(node.bit - 1, 1);
    		}
    		insert(val, node.right);
    	}else{
    		if(node.left == null){
    			node.left = new Node(node.bit - 1, 0);
    		}
    		insert(val, node.left);
    	}
    }

    static class Node{
    	int bit;
    	int val;
    	int count;
    	Node left, right;
		public Node(int bit, int val) {
			super();
			this.bit = bit;
			this.val = val;
		}

    }

    public static int[] KMP(String val) {
        int i = 0;
        int j = -1;
        int[] result = new int[val.length() + 1];
        result[0] = -1;
        while (i < val.length()) {
            while (j >= 0 && val.charAt(j) != val.charAt(i)) {
                j = result[j];
            }
            j++;
            i++;
            result[i] = j;
        }
        return result;

    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    public static int digit(long n) {
        int result = 0;
        while (n > 0) {
            n /= 10;
            result++;
        }
        return result;
    }

    public static double dist(long a, long b, long x, long y) {
        double val = (b - a) * (b - a) + (x - y) * (x - y);
        val = Math.sqrt(val);
        double other = x * x + a * a;
        other = Math.sqrt(other);
        return val + other;

    }

    public static class Point implements Comparable<Point> {

        int x, y;

        public Point(int start, int end) {
            this.x = start;
            this.y = end;
        }

        @Override
        public int hashCode() {
            int hash = 5;
            hash = 47 * hash + this.x;
            hash = 47 * hash + this.y;
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Point other = (Point) obj;
            if (this.x != other.x) {
                return false;
            }
            if (this.y != other.y) {
                return false;
            }
            return true;
        }

        @Override
        public int compareTo(Point o) {
            return x - o.x;
        }
    }

    public static class FT {

        long[] data;

        FT(int n) {
            data = new long[n];
        }

        public void update(int index, long value) {
            while (index < data.length) {
                data[index] += value;
                index += (index & (-index));
            }
        }

        public long get(int index) {
            long result = 0;
            while (index > 0) {
                result += data[index];
                index -= (index & (-index));
            }
            return result;

        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long pow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val % MOD;
        } else {
            return val * (val * a % MOD) % MOD;

        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //  br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 * @author pttrung
 */
public class E_Round_173_Div2 {

    public static long MOD = 1000000007;

    public static void main(String[] args) throws FileNotFoundException {
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File(
        // "output.txt")));
        PrintWriter out = new PrintWriter(System.out);
        Scanner in = new Scanner();
        int n = in.nextInt();
        long[]data = new long[n];
        long[]post = new long[n];
        for(int i = n - 1; i >= 0; i--){
        	post[i] = data[i];
        	if(i + 1 < n){
        		post[i] |= post[i + 1];
        	}
        }
        long max = 0;
        for(int i = n - 1; i >= 0; i--){
        	if(max > post[i]){
        		post[i] = max;
        	}else{
        		max = post[i];
        	}
        }
        max = 0;
        long result = 0;
        long pre = 0;
        for(int i = 0; i < n; i++){
        	pre |= data[i];
        	if(max < pre){
        		max = pre;
        	}
        	long tmp = 0;
        	if(i + 1 < n){
        		tmp = max + post[i + 1];
        	}else{
        		tmp = max;
        	}
        	if(tmp > result){
        		result = tmp;
        	}
        }
        out.println(result);

        out.close();
    }

    public static int[] KMP(String val) {
        int i = 0;
        int j = -1;
        int[] result = new int[val.length() + 1];
        result[0] = -1;
        while (i < val.length()) {
            while (j >= 0 && val.charAt(j) != val.charAt(i)) {
                j = result[j];
            }
            j++;
            i++;
            result[i] = j;
        }
        return result;

    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    public static int digit(long n) {
        int result = 0;
        while (n > 0) {
            n /= 10;
            result++;
        }
        return result;
    }

    public static double dist(long a, long b, long x, long y) {
        double val = (b - a) * (b - a) + (x - y) * (x - y);
        val = Math.sqrt(val);
        double other = x * x + a * a;
        other = Math.sqrt(other);
        return val + other;

    }

    public static class Point implements Comparable<Point> {

        int x, y;

        public Point(int start, int end) {
            this.x = start;
            this.y = end;
        }

        @Override
        public int hashCode() {
            int hash = 5;
            hash = 47 * hash + this.x;
            hash = 47 * hash + this.y;
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Point other = (Point) obj;
            if (this.x != other.x) {
                return false;
            }
            if (this.y != other.y) {
                return false;
            }
            return true;
        }

        @Override
        public int compareTo(Point o) {
            return x - o.x;
        }
    }

    public static class FT {

        long[] data;

        FT(int n) {
            data = new long[n];
        }

        public void update(int index, long value) {
            while (index < data.length) {
                data[index] += value;
                index += (index & (-index));
            }
        }

        public long get(int index) {
            long result = 0;
            while (index > 0) {
                result += data[index];
                index -= (index & (-index));
            }
            return result;

        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long pow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val % MOD;
        } else {
            return val * (val * a % MOD) % MOD;

        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //  br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 * @author pttrung
 */
public class E_Round_173_Div2 {

    public static long MOD = 1000000007;

    public static void main(String[] args) throws FileNotFoundException {
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File(
        // "output.txt")));
        PrintWriter out = new PrintWriter(System.out);
        Scanner in = new Scanner();
        int n = in.nextInt();
        long[]data = new long[n];
        long[]post = new long[n];
        for(int i = 0; i< n; i++){
        	data[i] = in.nextLong();
        }
        for(int i = n - 1; i >= 0; i--){
        	post[i] = data[i];
        	if(i + 1 < n){
        		post[i] |= post[i + 1];
        	}
        }
        long max = 0;
        for(int i = n - 1; i >= 0; i--){
        	if(max > post[i]){
        		post[i] = max;
        	}else{
        		max = post[i];
        	}
        }
        max = 0;
        long result = 0;
        long pre = 0;
        for(int i = 0; i < n; i++){
        	pre |= data[i];
        	if(max < pre){
        		max = pre;
        	}
        	long tmp = 0;
        	if(i + 1 < n){
        		tmp = max + post[i + 1];
        	}else{
        		tmp = max;
        	}
        	if(tmp > result){
        		result = tmp;
        	}
        }
        out.println(result);

        out.close();
    }

    public static int[] KMP(String val) {
        int i = 0;
        int j = -1;
        int[] result = new int[val.length() + 1];
        result[0] = -1;
        while (i < val.length()) {
            while (j >= 0 && val.charAt(j) != val.charAt(i)) {
                j = result[j];
            }
            j++;
            i++;
            result[i] = j;
        }
        return result;

    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    public static int digit(long n) {
        int result = 0;
        while (n > 0) {
            n /= 10;
            result++;
        }
        return result;
    }

    public static double dist(long a, long b, long x, long y) {
        double val = (b - a) * (b - a) + (x - y) * (x - y);
        val = Math.sqrt(val);
        double other = x * x + a * a;
        other = Math.sqrt(other);
        return val + other;

    }

    public static class Point implements Comparable<Point> {

        int x, y;

        public Point(int start, int end) {
            this.x = start;
            this.y = end;
        }

        @Override
        public int hashCode() {
            int hash = 5;
            hash = 47 * hash + this.x;
            hash = 47 * hash + this.y;
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Point other = (Point) obj;
            if (this.x != other.x) {
                return false;
            }
            if (this.y != other.y) {
                return false;
            }
            return true;
        }

        @Override
        public int compareTo(Point o) {
            return x - o.x;
        }
    }

    public static class FT {

        long[] data;

        FT(int n) {
            data = new long[n];
        }

        public void update(int index, long value) {
            while (index < data.length) {
                data[index] += value;
                index += (index & (-index));
            }
        }

        public long get(int index) {
            long result = 0;
            while (index > 0) {
                result += data[index];
                index -= (index & (-index));
            }
            return result;

        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long pow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val % MOD;
        } else {
            return val * (val * a % MOD) % MOD;

        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //  br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 *
 * @author pttrung
 */
public class E_Round_173_Div2 {

	public static long MOD = 1000000007;
	static long re;

	public static void main(String[] args) throws FileNotFoundException {
		// PrintWriter out = new PrintWriter(new FileOutputStream(new File(
		// "output.txt")));
		PrintWriter out = new PrintWriter(System.out);
		Scanner in = new Scanner();
		int n = in.nextInt();
		long[] data = new long[n];
		long[] post = new long[n];
		for (int i = 0; i < n; i++) {
			data[i] = in.nextLong();
		}
		long result = 0;
		Node root = new Node(40, 0);
		for (int i = n - 1; i >= 0; i--) {
			post[i] = data[i];
			if (i + 1 < n) {
				post[i] ^= post[i + 1];
			}
			if (result < post[i]) {
				result = post[i];
			}
			insert(post[i], root);

		}
		long pre = 0;

		for (int i = 0; i < n - 1; i++) {
			pre ^= data[i];
			// System.out.println(Long.toBinaryString(pre) + " " + pre);

			remove(post[i], root);
			re = 0;
			getMax(pre, root);
			if (re < pre) {
				re = pre;
			}
			if (re > result) {
				result = re;
			}

		}
		out.println(result);

		out.close();
	}

	static void getMax(long val, Node node) {
		int bit = ((1L << node.bit) & val) == 0 ? 0 : 1;
		if (bit == 1 && node.val == 1) {
			val ^= (1L << node.bit);
		} else if (node.val == 1) {
			val |= (1L << node.bit);
		}
		if (node.bit == 0) {
			re = val;
			return;
		}
		long result;
		bit = ((1L << (node.bit - 1)) & val) == 0 ? 0 : 1;

		if (bit == 0) {
			if (node.right != null && node.right.count > 0) {
				getMax(val, node.right);
			} else if (node.left != null && node.left.count > 0) {
				getMax(val, node.left);
			} else {
				re = val;
			}
		} else {
			if (node.left != null && node.left.count > 0) {
				getMax(val, node.left);
			} else if (node.right != null && node.right.count > 0) {
				getMax(val, node.right);
			} else {
				re = val;
			}
		}

	}

	static void remove(long val, Node node) {
		node.count--;
		if (node.bit == 0) {
			return;
		}
		long nxt = val & (1L << (node.bit - 1));
		if (nxt != 0) {
			remove(val, node.right);
		} else {
			remove(val, node.left);
		}
	}

	static void insert(long val, Node node) {
		node.count++;
		if (node.bit == 0) {

			return;
		}
		long nxt = val & (1L << (node.bit - 1));
		if (nxt != 0) {
			if (node.right == null) {
				node.right = new Node(node.bit - 1, 1);
			}
			insert(val, node.right);
		} else {
			if (node.left == null) {
				node.left = new Node(node.bit - 1, 0);
			}
			insert(val, node.left);
		}
	}

	static class Node {
		int bit;
		int val;
		int count;
		Node left, right;

		public Node(int bit, int val) {
			super();
			this.bit = bit;
			this.val = val;
		}

	}

	public static int[] KMP(String val) {
		int i = 0;
		int j = -1;
		int[] result = new int[val.length() + 1];
		result[0] = -1;
		while (i < val.length()) {
			while (j >= 0 && val.charAt(j) != val.charAt(i)) {
				j = result[j];
			}
			j++;
			i++;
			result[i] = j;
		}
		return result;

	}

	public static boolean nextPer(int[] data) {
		int i = data.length - 1;
		while (i > 0 && data[i] < data[i - 1]) {
			i--;
		}
		if (i == 0) {
			return false;
		}
		int j = data.length - 1;
		while (data[j] < data[i - 1]) {
			j--;
		}
		int temp = data[i - 1];
		data[i - 1] = data[j];
		data[j] = temp;
		Arrays.sort(data, i, data.length);
		return true;
	}

	public static int digit(long n) {
		int result = 0;
		while (n > 0) {
			n /= 10;
			result++;
		}
		return result;
	}

	public static double dist(long a, long b, long x, long y) {
		double val = (b - a) * (b - a) + (x - y) * (x - y);
		val = Math.sqrt(val);
		double other = x * x + a * a;
		other = Math.sqrt(other);
		return val + other;

	}

	public static class Point implements Comparable<Point> {

		int x, y;

		public Point(int start, int end) {
			this.x = start;
			this.y = end;
		}

		@Override
		public int hashCode() {
			int hash = 5;
			hash = 47 * hash + this.x;
			hash = 47 * hash + this.y;
			return hash;
		}

		@Override
		public boolean equals(Object obj) {
			if (obj == null) {
				return false;
			}
			if (getClass() != obj.getClass()) {
				return false;
			}
			final Point other = (Point) obj;
			if (this.x != other.x) {
				return false;
			}
			if (this.y != other.y) {
				return false;
			}
			return true;
		}

		@Override
		public int compareTo(Point o) {
			return x - o.x;
		}
	}

	public static class FT {

		long[] data;

		FT(int n) {
			data = new long[n];
		}

		public void update(int index, long value) {
			while (index < data.length) {
				data[index] += value;
				index += (index & (-index));
			}
		}

		public long get(int index) {
			long result = 0;
			while (index > 0) {
				result += data[index];
				index -= (index & (-index));
			}
			return result;

		}
	}

	public static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	public static long pow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b == 1) {
			return a;
		}
		long val = pow(a, b / 2);
		if (b % 2 == 0) {
			return val * val % MOD;
		} else {
			return val * (val * a % MOD) % MOD;

		}
	}

	static class Scanner {

		BufferedReader br;
		StringTokenizer st;

		public Scanner() throws FileNotFoundException {
			// System.setOut(new PrintStream(new
			// BufferedOutputStream(System.out), true));
			br = new BufferedReader(new InputStreamReader(System.in));
			// br = new BufferedReader(new InputStreamReader(new
			// FileInputStream(new File("input.txt"))));
		}

		public String next() {

			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					throw new RuntimeException();
				}
			}
			return st.nextToken();
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			st = null;
			try {
				return br.readLine();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}

		public boolean endLine() {
			try {
				String next = br.readLine();
				while (next != null && next.trim().isEmpty()) {
					next = br.readLine();
				}
				if (next == null) {
					return true;
				}
				st = new StringTokenizer(next);
				return st.hasMoreTokens();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}
	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 * @author pttrung
 */
public class E_Round_173_Div2 {

    public static long MOD = 1000000007;

    public static void main(String[] args) throws FileNotFoundException {
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File(
        // "output.txt")));
        PrintWriter out = new PrintWriter(System.out);
        Scanner in = new Scanner();
        int n = in.nextInt();
        long[]data = new long[n];
        long[]post = new long[n];
        for(int i = 0; i< n; i++){
        	data[i] = in.nextLong();
        }
        long result = 0;
        Node root = new Node(63,0);
        for(int i = n - 1; i >= 0; i--){
        	post[i] = data[i];
        	if(i + 1 < n){
        		post[i] ^= post[i + 1];
        	}
        	if(result < post[i]){
        		result = post[i];
        	}
        	insert(post[i], root);

        }
        long pre = 0;

        for(int i = 0; i < n - 1; i++){
        	pre ^= data[i];
        	//System.out.println(Long.toBinaryString(pre) + " " + pre);

        	remove(post[i], root);
        	long v = getMax(pre, root);
        	if(v < pre){
        		v = pre;
        	}
        	if(v > result){
        		result = v;
        	}

        }
        out.println(result );

        out.close();
    }
    static long getMax(long val, Node node){
    	int bit = ((1<< node.bit)& val) == 0 ? 0 : 1;
    	if(node.bit == 0){

    		return bit ^ node.val;
    	}
    	long result = (bit ^ node.val) << (node.bit);
    	bit = ((1<<(node.bit - 1)) & val) == 0 ? 0 : 1;

    	if(bit == 0){
    		if(node.right != null && node.right.count > 0){
    			result |= getMax(val, node.right);
    		}else{
    			result |= getMax(val, node.left);
    		}
    	}else{
    		if(node.left != null && node.left.count > 0){
    			result |= getMax(val, node.left);
    		}else{
    			result |= getMax(val, node.right);
    		}
    	}
    	return result;

    }

    static void remove(long val, Node node){
    	node.count--;
    	if(node.bit == 0){
    		return;
    	}
    	long nxt = val & (1<<(node.bit - 1));
    	if(nxt != 0){
    		remove(val, node.right);
    	}else{
    		remove(val, node.left);
    	}
    }
    static void insert(long val, Node node){
    	node.count++;
    	if(node.bit == 0){

    		return;
    	}
    	long nxt = val & (1<<(node.bit - 1));
    	if(nxt != 0){
    		if(node.right == null){
    			node.right = new Node(node.bit - 1, 1);
    		}
    		insert(val, node.right);
    	}else{
    		if(node.left == null){
    			node.left = new Node(node.bit - 1, 0);
    		}
    		insert(val, node.left);
    	}
    }

    static class Node{
    	int bit;
    	int val;
    	int count;
    	Node left, right;
		public Node(int bit, int val) {
			super();
			this.bit = bit;
			this.val = val;
		}

    }

    public static int[] KMP(String val) {
        int i = 0;
        int j = -1;
        int[] result = new int[val.length() + 1];
        result[0] = -1;
        while (i < val.length()) {
            while (j >= 0 && val.charAt(j) != val.charAt(i)) {
                j = result[j];
            }
            j++;
            i++;
            result[i] = j;
        }
        return result;

    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    public static int digit(long n) {
        int result = 0;
        while (n > 0) {
            n /= 10;
            result++;
        }
        return result;
    }

    public static double dist(long a, long b, long x, long y) {
        double val = (b - a) * (b - a) + (x - y) * (x - y);
        val = Math.sqrt(val);
        double other = x * x + a * a;
        other = Math.sqrt(other);
        return val + other;

    }

    public static class Point implements Comparable<Point> {

        int x, y;

        public Point(int start, int end) {
            this.x = start;
            this.y = end;
        }

        @Override
        public int hashCode() {
            int hash = 5;
            hash = 47 * hash + this.x;
            hash = 47 * hash + this.y;
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Point other = (Point) obj;
            if (this.x != other.x) {
                return false;
            }
            if (this.y != other.y) {
                return false;
            }
            return true;
        }

        @Override
        public int compareTo(Point o) {
            return x - o.x;
        }
    }

    public static class FT {

        long[] data;

        FT(int n) {
            data = new long[n];
        }

        public void update(int index, long value) {
            while (index < data.length) {
                data[index] += value;
                index += (index & (-index));
            }
        }

        public long get(int index) {
            long result = 0;
            while (index > 0) {
                result += data[index];
                index -= (index & (-index));
            }
            return result;

        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long pow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val % MOD;
        } else {
            return val * (val * a % MOD) % MOD;

        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //  br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 * @author pttrung
 */
public class E_Round_173_Div2 {

    public static long MOD = 1000000007;

    public static void main(String[] args) throws FileNotFoundException {
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File(
        // "output.txt")));
        PrintWriter out = new PrintWriter(System.out);
        Scanner in = new Scanner();
        int n = in.nextInt();
        long[]data = new long[n];
       long max = 0;
        for(int i = 0; i< n; i++){
        	data[i] = in.nextLong();
        	max |= data[i];
        }
        out.println(max);

        out.close();
    }

    public static int[] KMP(String val) {
        int i = 0;
        int j = -1;
        int[] result = new int[val.length() + 1];
        result[0] = -1;
        while (i < val.length()) {
            while (j >= 0 && val.charAt(j) != val.charAt(i)) {
                j = result[j];
            }
            j++;
            i++;
            result[i] = j;
        }
        return result;

    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    public static int digit(long n) {
        int result = 0;
        while (n > 0) {
            n /= 10;
            result++;
        }
        return result;
    }

    public static double dist(long a, long b, long x, long y) {
        double val = (b - a) * (b - a) + (x - y) * (x - y);
        val = Math.sqrt(val);
        double other = x * x + a * a;
        other = Math.sqrt(other);
        return val + other;

    }

    public static class Point implements Comparable<Point> {

        int x, y;

        public Point(int start, int end) {
            this.x = start;
            this.y = end;
        }

        @Override
        public int hashCode() {
            int hash = 5;
            hash = 47 * hash + this.x;
            hash = 47 * hash + this.y;
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Point other = (Point) obj;
            if (this.x != other.x) {
                return false;
            }
            if (this.y != other.y) {
                return false;
            }
            return true;
        }

        @Override
        public int compareTo(Point o) {
            return x - o.x;
        }
    }

    public static class FT {

        long[] data;

        FT(int n) {
            data = new long[n];
        }

        public void update(int index, long value) {
            while (index < data.length) {
                data[index] += value;
                index += (index & (-index));
            }
        }

        public long get(int index) {
            long result = 0;
            while (index > 0) {
                result += data[index];
                index -= (index & (-index));
            }
            return result;

        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long pow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val % MOD;
        } else {
            return val * (val * a % MOD) % MOD;

        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //  br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}