import java.util.Scanner;

public class CF282E {

    public static void main(String[] args) throws Exception {
        new CF282E().solve();
    }

    private void solve() throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        long leftXor = 0;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            leftXor ^= a[i];
        }

        BitTrie trie = new BitTrie(60);
        trie.insert(0);
        long rightXor = 0;
        long max = leftXor;

        for (int i = n - 1; i >= 0; i--) {
            leftXor ^= a[i];
            rightXor ^= a[i];
            trie.insert(rightXor);
            max = Math.max(max, leftXor ^ trie.findNearest(~leftXor));
        }
        System.out.println(max);
    }

    static class BitTrie {
        BitTrie[] children = new BitTrie[2];
        final int childBit;

        public BitTrie(int childBit) {
            this.childBit = childBit;
        }

        void insert(long v) {
            if (childBit < 0) return;
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) children[ch] = new BitTrie(childBit - 1);
            children[ch].insert(v);
        }

        long findNearest(long v) {
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) ch ^= 1;
            return (ch == 0 ? 0 : (1 << childBit)) + (childBit >= 0 ? children[ch].findNearest(v) : 0);
        }
    }
}


import java.util.Scanner;

public class CF282E {

    public static void main(String[] args) throws Exception {
        new CF282E().solve();
    }

    private void solve() throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        long leftXor = 0;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            leftXor ^= a[i];
        }

        BitTrie trie = new BitTrie(60);
        trie.insert(0);
        long rightXor = 0;
        long max = leftXor;

        for (int i = n - 1; i >= 0; i--) {
            leftXor ^= a[i];
            rightXor ^= a[i];
            trie.insert(rightXor);
            max = Math.max(max, leftXor ^ trie.findNearest(~leftXor));
        }
        System.out.println(max);
    }

    static class BitTrie {
        BitTrie[] children = new BitTrie[2];
        final int childBit;

        public BitTrie(int childBit) {
            this.childBit = childBit;
        }

        void insert(long v) {
            if (childBit < 0) return;
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) children[ch] = new BitTrie(childBit - 1);
            children[ch].insert(v);
        }

        long findNearest(long v) {
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) ch ^= 1;
            return (ch == 0 ? 0 : (1 << childBit)) + (childBit > 0 ? children[ch].findNearest(v) : 0);
        }
    }
}


import java.util.Scanner;

public class CF282E {

    public static void main(String[] args) throws Exception {
        new CF282E().solve();
    }

    private void solve() throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        long leftXor = 0;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            leftXor ^= a[i];
        }

        BitTrie trie = new BitTrie(62);
        trie.insert(0);
        long rightXor = 0;
        long max = leftXor;

        for (int i = n - 1; i >= 0; i--) {
            leftXor ^= a[i];
            rightXor ^= a[i];
            trie.insert(rightXor);
            max = Math.max(max, leftXor ^ trie.findNearest(~leftXor));
        }
        System.out.println(max);
    }

    static class BitTrie {
        BitTrie[] children = new BitTrie[2];
        final int childBit;

        public BitTrie(int childBit) {
            this.childBit = childBit;
        }

        void insert(long v) {
            if (childBit < 0) return;
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) children[ch] = new BitTrie(childBit - 1);
            children[ch].insert(v);
        }

        long findNearest(long v) {
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) ch ^= 1;
            return (ch == 0 ? 0 : (1L << childBit)) + (childBit >= 0 ? children[ch].findNearest(v) : 0);
        }
    }
}


import java.util.Scanner;

public class CF282E {

    public static void main(String[] args) throws Exception {
        new CF282E().solve();
    }

    private void solve() throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        long leftXor = 0;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            leftXor ^= a[i];
        }

        BitTrie trie = new BitTrie(62);
        trie.insert(0);
        long rightXor = 0;
        long max = leftXor;

        for (int i = n - 1; i >= 0; i--) {
            leftXor ^= a[i];
            rightXor ^= a[i];
            trie.insert(rightXor);
            max = Math.max(max, leftXor ^ trie.findNearest(~leftXor));
        }
        System.out.println(max);
    }

    static class BitTrie {
        BitTrie[] children = new BitTrie[2];
        final int childBit;

        public BitTrie(int childBit) {
            this.childBit = childBit;
        }

        void insert(long v) {
            if (childBit < 0) return;
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) children[ch] = new BitTrie(childBit - 1);
            children[ch].insert(v);
        }

        long findNearest(long v) {
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) ch ^= 1;
            return (ch == 0 ? 0 : (1 << childBit)) + (childBit >= 0 ? children[ch].findNearest(v) : 0);
        }
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class CF282E {

    public static void main(String[] args) throws Exception {
        new CF282E().solve();
    }

    private void solve() throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] sl = br.readLine().split(" ");
        long[] a = new long[n];
        long leftXor = 0;
        for (int i = 0; i < n; i++) {
            a[i] = Long.parseLong(sl[i]);
            leftXor ^= a[i];
        }

        BitTrie trie = new BitTrie(40);
        trie.insert(0);
        long rightXor = 0;
        long max = leftXor;

        for (int i = n - 1; i >= 0; i--) {
            leftXor ^= a[i];
            rightXor ^= a[i];
            trie.insert(rightXor);
            max = Math.max(max, leftXor ^ trie.findNearest(~leftXor));
        }
        System.out.println(max);
    }

    static class BitTrie {
        BitTrie[] children = new BitTrie[2];
        final int childBit;

        public BitTrie(int childBit) {
            this.childBit = childBit;
        }

        void insert(long v) {
            if (childBit < 0) return;
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) children[ch] = new BitTrie(childBit - 1);
            children[ch].insert(v);
        }

        long findNearest(long v) {
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) ch ^= 1;
            return (ch == 0 ? 0 : (1L << childBit)) + (childBit >= 0 ? children[ch].findNearest(v) : 0);
        }
    }
}


import java.util.Scanner;

public class CF282E {

    public static void main(String[] args) throws Exception {
        new CF282E().solve();
    }

    private void solve() throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        long leftXor = 0;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            leftXor ^= a[i];
        }

        BitTrie trie = new BitTrie(50);
        trie.insert(0);
        long rightXor = 0;
        long max = leftXor;

        for (int i = n - 1; i >= 0; i--) {
            leftXor ^= a[i];
            rightXor ^= a[i];
            trie.insert(rightXor);
            max = Math.max(max, leftXor ^ trie.findNearest(~leftXor));
        }
        System.out.println(max);
    }

    static class BitTrie {
        BitTrie[] children = new BitTrie[2];
        final int childBit;

        public BitTrie(int childBit) {
            this.childBit = childBit;
        }

        void insert(long v) {
            if (childBit < 0) return;
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) children[ch] = new BitTrie(childBit - 1);
            children[ch].insert(v);
        }

        long findNearest(long v) {
            int ch = (v & (1L << childBit)) == 0 ? 0 : 1;
            if (children[ch] == null) ch ^= 1;
            return (ch == 0 ? 0 : (1L << childBit)) + (childBit >= 0 ? children[ch].findNearest(v) : 0);
        }
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class E {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		BitSausage bs = new BitSausage();
		bs.solve();
		bs.print();
	}

}

class BitSausage {

	BitSausage() {
		Scanner scr = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		n = scr.nextInt();

		s = new long[n+1];
		for (int i = 1; i <= n; i++){
			s[i] = scr.nextLong();
		}

		app = new long[n+1];
	}

	void solve() {

		for (int i = 1; i <= n; i++){
			app[i] = s[i] ^ app[i-1];
		}

		xor = app[n];

		Arrays.sort(app);

		int maxbits = 0;
		long maxapp = app[n];
		while (maxapp > 0) {
			maxapp = maxapp >> 1;
			maxbits++;
		}

		long [] appp = new long[n+1];

		long y = 0;
		long test;
		int ind = -1;
		long xork;

		for (int k = maxbits-1; k >= 0; k--){
			for (int i = 0; i <= n; i++){
				appp[i] = (app[i] >> k);
			}
			xork = xor >> k;

			for (int i = 0; i <= n; i++){
				test = appp[i] ^ xork ^ ((y << 1) + 1);
				ind = Arrays.binarySearch(app, test);
				if (ind >= 0) {
					break;
				}
			}

			if (ind >= 0) {
				y = (y << 1) + 1;
			}
			else {
				y = (y << 1);
			}
		}

		maxp = y;
	}

	void print() {
		System.out.println(maxp);
	}

	long xor;
	long maxp;
	long[] app;
	long[] s;
	int n;
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class E {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		BitSausage bs = new BitSausage();
		bs.solve();
		bs.print();
	}

}

class BitSausage {

	BitSausage() {
		Scanner scr = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		n = scr.nextInt();

		s = new long[n+1];
		for (int i = 1; i <= n; i++){
			s[i] = scr.nextLong();
		}

		app = new long[n+1];
	}

	void solve() {

		for (int i = 1; i <= n; i++){
			app[i] = s[i] ^ app[i-1];
		}

		xor = app[n];

		Arrays.sort(app);

		int maxbits = 0;
		long maxapp = app[n];
		while (maxapp > 0) {
			maxapp = maxapp >> 1;
			maxbits++;
		}

		long [] appp = new long[n+1];

		long y = 0;
		long test;
		int ind = -1;
		long xork;

		for (int k = maxbits-1; k >= 0; k--){
			for (int i = 0; i <= n; i++){
				appp[i] = (app[i] >> k);
			}
			xork = xor >> k;

			for (int i = 0; i <= n; i++){
				test = appp[i] ^ xork ^ ((y << 1) + 1);
				ind = Arrays.binarySearch(appp, test);
				if (ind >= 0) {
					break;
				}
			}

			if (ind >= 0) {
				y = (y << 1) + 1;
			}
			else {
				y = (y << 1);
			}
		}

		maxp = y;
	}

	void print() {
		System.out.println(maxp);
	}

	long xor;
	long maxp;
	long[] app;
	long[] s;
	int n;
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class ProblemE{
	public static void main(String[] args){
		FastScanner sc = new FastScanner();
		int n = sc.nextInt();
		long[] a = new long[n];
		for(int i=0; i<n; i++){
			a[i] = sc.nextLong();
		}

		long[] delLeft = new long[n];
		delLeft[0] = a[0];
		long curXor = a[0];
		for(int i=1; i<n;i++){
			curXor ^= a[i];
			delLeft[i] = curXor;
		}

		//System.out.println("delLeft = " + Arrays.toString(delLeft));
		long[] delRight = new long[n];
		delRight[n-1] = a[n-1];
		curXor = a[n-1];
		for(int i=n-2; i>=0;i--){
			curXor ^= a[i];
			delRight[i] = curXor;
		}
		//System.out.println("delRight = " + Arrays.toString(delRight));
		//idk... im pretty sure this o(n^2) wouldnt work :(
		//the entire thing
		long maxXor = delLeft[n-1];
		//if left is empty
		for(int right=1; right<n; right++){
			maxXor = Math.max(delRight[right], maxXor);
		}
		//if right is empty
		for(int left=0; left<n-1; left++){
			maxXor = Math.max(delLeft[left], maxXor);
		}
		for(int left=0; left<n; left++){
			for(int right=left+2;right<n;right++){
				maxXor = Math.max(delLeft[left] ^ delRight[right], maxXor);
			}
		}
		System.out.println(maxXor);
	}

	public static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(nextToken());
		}

		long nextLong() {
			return Long.parseLong(nextToken());
		}

		double nextDouble() {
			return Double.parseDouble(nextToken());
		}
	}
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class SausageMaxRedo {
	public static void main(String[] args){
		FastScanner sc = new FastScanner();
		int n = sc.nextInt();
		long[] a = new long[n];
		for(int i=0; i<n; i++){
			a[i] = sc.nextLong();
		}

		//i is one-based. if 0, 0.
		long[] delLeft = new long[n+1];
		delLeft[0] = 0;
		delLeft[1] = a[0];
		long curXor = a[0];
		for(int i=1; i<n;i++){
			curXor ^= a[i];
			delLeft[i+1] = curXor;
		}

		Long[] delRight = new Long[n+1];
		delRight[0] = (long) 0;
		delRight[1] = a[n-1];
		curXor = a[n-1];
		for(int i=1; i<n;i++){
			curXor ^= a[n-i-1];
			delRight[i+1] = curXor;
		}

		Arrays.sort(delRight);

		//for each left, find right that max {leftVal ^ rightVal}
		//it's ok if right overlaps with left, because xor will cancel them out, and we
		//are taking the max including cases where left does not overlap with right
		long max = 0;
		for(int left=0;left<=n;left++){
			//2^40 >= (2^10)^4 > 1000^4 = 10^12
			long rightVal = 0;
			//inv: arr[lo] <= rightVal <= arr[hi] and arr[lo] matches arr[hi] for the left 40..40-i digits
			int lo = 0;
			int hi = n;
			//fill bits for rightVal one by one starting from highest bit
			for(long i=40; i>=0; i--){
				long sep = rightVal + (((long)1)<<i);
				int ind = binSearch(delRight, lo, hi, sep);
				if(ind == -1){
					//everybody has bit = 1, so no choice but to make this bit =1 too
					rightVal = sep;
				}else if(ind == hi){
					//everybody has bit = 0, so we have to choose 0 and leave rightVal untouched
				}else{
					//some have 0, some have 1
					//ind+1 points to the first guy who has 1
					int leftBit = (int) ((delLeft[left] >> i) & 1);
					if(leftBit == 0){
						//to max xor, gotta add 1 to this bit
						rightVal = sep;
						lo = ind+1;
					}else{
						//leftBit =1, make this bit = 0
						hi = ind;
					}
				}
			}
			max = Math.max(max, delLeft[left] ^ rightVal);
		}

		System.out.println(max);
	}

	//@return highest index where arr[lo]<s
	public static int binSearch(Long[] arr, int lo, int hi, long s){
		if(arr[lo]>=s){
			lo = -1;
		}else{
			while(lo < hi){
				int mid = lo + (hi-lo+1)/2;
				if(arr[mid] >= s){
					hi = mid-1;
				}else{
					lo = mid;
				}
			}
		}
		return lo;
	}

	public static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(nextToken());
		}

		long nextLong() {
			return Long.parseLong(nextToken());
		}

		double nextDouble() {
			return Double.parseDouble(nextToken());
		}
	}
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class ProblemE{
	public static void main(String[] args){
		FastScanner sc = new FastScanner();
		int n = sc.nextInt();
		long[] a = new long[n];
		for(int i=0; i<n; i++){
			a[i] = sc.nextLong();
		}

		long[] delLeft = new long[n];
		delLeft[0] = a[0];
		long curXor = a[0];
		for(int i=1; i<n;i++){
			curXor ^= a[i];
			delLeft[i] = curXor;
		}

		//System.out.println("delLeft = " + Arrays.toString(delLeft));
		long[] delRight = new long[n];
		delRight[n-1] = a[n-1];
		curXor = a[n-1];
		for(int i=n-2; i>=0;i--){
			curXor ^= a[i];
			delRight[i] = curXor;
		}
		//System.out.println("delRight = " + Arrays.toString(delRight));
		//idk... im pretty sure this o(n^2) wouldnt work :(
		//the entire thing
		long maxXor = delLeft[n-1];
		//if left is empty
		for(int right=0; right<n; right++){
			maxXor = Math.max(delRight[right], maxXor);
		}
		//if right is empty
		for(int left=0; left<n; left++){
			maxXor = Math.max(delLeft[left], maxXor);
		}
		for(int left=0; left<n; left++){
			for(int right=left+2;right<n;right++){
				maxXor = Math.max(delLeft[left] ^ delLeft[right], maxXor);
			}
		}
		System.out.println(maxXor);
	}

	public static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(nextToken());
		}

		long nextLong() {
			return Long.parseLong(nextToken());
		}

		double nextDouble() {
			return Double.parseDouble(nextToken());
		}
	}
}


import java.util.*;
import java.io.*;
public class Main {
static class Node{
	Node [] node = new Node[2];
	public Node(){
	}
	public Node getChild(int a){
		if(node[a] == null)
			node[a] = new Node();
		return node[a];
	}
}
static void add(Node tree,long val){
	Node current = tree;
	for(int i = 40;i >= 0;i--){
		if(((val >> i) & 1) != 0){
             current = current.getChild(1);
		}
		else current = current.getChild(0);
	}
}
static long findMax(long res,Node tree){
	Node current = tree;
	long ans = 0;
	for(int i = 40;i >= 0;i--){
		if(((res >> i) & 1 )== 0){
			Node temp = current.node[1];
			if(temp != null){
			ans |= (1L << i);
			current = temp;
		}
		    else current = current.node[0];
		}
		else{
			Node temp = current.node[0];
			if(temp != null){
			ans |= (1L << i);
			current = temp;
		}
		    else current = current.node[1];
		}
	}
	 return ans;
}
public static void main(String [] args)throws Exception{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	int n = Integer.parseInt(br.readLine());
	long array[] = new long[n];
	StringTokenizer st = new StringTokenizer(br.readLine());
	long totxor = 0;
	for(int i = 0;i < n;i++){
		array[i] = Long.parseLong(st.nextToken());
	    totxor ^= array[i];
	}
	Node tree = new Node();
	long remxor = 0;
	long ans = totxor;
	add(tree,0);
	for(int k = n - 1;k >= 0;k--){
	totxor ^= array[k];
	remxor ^= array[k];
	Node current = tree;
	for(int i = 40;i >= 0;i--){
		if(((remxor >> i) & 1) != 0){
             current = current.getChild(1);
		}
		else current = current.getChild(0);
	}
	ans = Math.max(ans,findMax(totxor,tree));
}
 System.out.println(ans);
}
}


import java.util.*;
import java.io.*;
public class Main {
static class Node{
	Node t1;
	Node t0;
	public Node(){
	}
	public static void add(Node tree,long val){
	Node current = tree;
	for(int i = 40;i >= 0;i--){
		if(((1L << i) & val) != 0){
			if(current.t1 == null){
			current.t1 = new Node();
			}
            current = current.t1;
		}
		else {
		if(current.t0 == null){
		current.t0 = new Node();
		}
		current = current.t0;
		}
	}
  }
}
static long findMax(long res,Node tree){
	Node current = tree;
	long ans = 0;
	for(int i = 40;i >= 0;i--){
		if(((1L << i) & res )== 0){
			if(current.t1 != null){
			ans |= (1L << i);
			current = current.t1;
		}
		    else current = current.t0;
		}
		else{
			if(current.t0 != null){
			ans |= (1L << i);
			current = current.t0;
		}
		    else current = current.t1;
		}
	}
	 return ans;
}
public static void main(String [] args)throws Exception{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	int n = Integer.parseInt(br.readLine());
	long array[] = new long[n];
	StringTokenizer st = new StringTokenizer(br.readLine());
	long totxor = 0;
	for(int i = 0;i < n;i++){
		totxor ^= (array[i] = Long.parseLong(st.nextToken()));
	}
	Node tree = new Node();
	long remxor = 0;
	long ans = totxor;
	tree.add(tree,0);
	for(int k = n - 1;k >= 0;k--){
	totxor ^= array[k];
	remxor ^= array[k];
	Node curr = tree;
	curr.add(tree,remxor);
	ans = Math.max(ans,findMax(totxor,curr));
}
 System.out.println(ans);
}
}


import java.util.*;
import java.io.*;
public class Main {
static class Node{
	Node t1;
	Node t0;
	public Node(){
	}
	public static void add(Node tree,long val){
	Node current = tree;
	for(int i = 40;i >= 0;i--){
		if(((1L << i) & val) != 0){
			if(current.t1 == null){
			current.t1 = new Node();
			}
            current = current.t1;
		}
		else {
		if(current.t0 == null){
		current.t0 = new Node();
		}
		current = current.t0;
		}
	}
  }
}
static long findMax(long res,Node tree){
	Node current = tree;
	long ans = 0;
	for(int i = 40;i >= 0;i--){
		if(((1L << i) & res )== 0){
			if(current.t1 != null){
			ans |= (1L << i);
			current = current.t1;
		}
		    else current = current.t0;
		}
		else{
			if(current.t0 != null){
			ans |= (1L << i);
			current = current.t0;
		}
		    else current = current.t1;
		}
	}
	 return ans;
}
public static void main(String [] args)throws Exception{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	int n = Integer.parseInt(br.readLine());
	long array[] = new long[n];
	StringTokenizer st = new StringTokenizer(br.readLine());
	long totxor = 0;
	for(int i = 0;i < n;i++){
		totxor ^= (array[i] = Long.parseLong(st.nextToken()));
	}
	Node tree = new Node();
	long remxor = 0;
	long ans = totxor;
	tree.add(tree,0);
	for(int k = n - 1;k >= 0;k--){
	totxor ^= array[k];
	remxor ^= array[k];
	tree.add(tree,remxor);
	ans = Math.max(ans,findMax(totxor,tree));
}
 System.out.println(ans);
}
}


import java.util.*;
import java.io.*;
public class Main {
static class Node{
	Node [] node = new Node[2];
	public Node(){
	}
	public Node getChild(int a){
		if(node[a] == null)
			node[a] = new Node();
		return node[a];
	}
	public static void add(Node tree,long val){
	Node current = tree;
	for(int i = 40;i >= 0;i--){
		if(((1L << i) & val) != 0){
			if(current.node[1] == null){
			current.node[1] = new Node();
			}
            current = current.node[1];
		}
		else {
		if(current.node[0] == null){
		current.node[0] = new Node();
		}
		current = current.node[0];
		}
	}
  }
}
static long findMax(long res,Node tree){
	Node current = tree;
	long ans = 0;
	//System.out.println(res);
	for(int i = 40;i >= 0;i--){
		//System.out.println(i);
		if(((1L << i) & res )== 0){
			Node temp = current.node[1];
			if(temp != null){
			ans |= (1L << i);
			current = temp;
		}
		    else current = current.node[0];
		    //if(current == null)System.out.println("fucked");
		}
		else{
			Node temp = current.node[0];
			if(temp != null){
			ans |= (1L << i);
			current = temp;
		}
		    else current = current.node[1];
		    //if(current == null)System.out.println("fucked");
		}
	}
	 return ans;
}
public static void main(String [] args)throws Exception{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	int n = Integer.parseInt(br.readLine());
	long array[] = new long[n];
	StringTokenizer st = new StringTokenizer(br.readLine());
	long totxor = 0;
	for(int i = 0;i < n;i++){
		array[i] = Long.parseLong(st.nextToken());
	    totxor ^= array[i];
	}
	Node tree = new Node();
	long remxor = 0;
	long ans = totxor;
	tree.add(tree,0);
	for(int k = n - 1;k >= 0;k--){
	totxor ^= array[k];
	remxor ^= array[k];
	tree.add(tree,remxor);
	ans = Math.max(ans,findMax(totxor,tree));
}
 System.out.println(ans);
}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Round173_E {

    class Node {
        Node zero, one;

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

    Node root;

    public void add(Node node, long val, int bit) {
        if (bit == -1)
            return;
        boolean zero = (val & (1L << bit)) == 0;
        if (zero) {
            if (node.zero == null)
                node.zero = new Node();
            add(node.zero, val, bit - 1);
        } else {
            if (node.one == null)
                node.one = new Node();
            add(node.one, val, bit - 1);
        }
    }

    // must add before match query
    public long maxMatch(Node node, long val, int bit) {
        if (bit == -1)
            return 0;
        boolean zero = (val & (1L << bit)) == 0;
        if ((zero && node.one != null)) {
            return (1L << bit) + maxMatch(node.one, val, bit - 1);
        } else if ((!zero && node.zero != null))
            return (1L << bit) + maxMatch(node.zero, val, bit - 1);
        else if (zero)
            return maxMatch(node.zero, val, bit - 1);
        else
            return maxMatch(node.one, val, bit - 1);
    }

    int N;

    public void solve() throws Exception {

        InputReader in = new InputReader();
        N = in.nextInt();
        long[] a = new long[N];
        for (int i = 0; i < N; i++) {
            a[i] = in.nextLong();
        }
        long left[] = new long[N];
        left[0] = a[0];
        long ans = left[0];
        for (int i = 1; i < N; i++)
        {
            left[i] = a[i] ^ left[i - 1];
            ans = Math.max(ans,left[i]);
        }
        root = new Node();
        long right = 0;
        for (int i = N - 1; i > -1; i--) {
            right ^= a[i];
            add(root, right, 40);
            ans = Math.max(ans,right);
            ans = Math.max(ans, maxMatch(root, left[i], 40));
        }
        System.out.println(ans);
    }

    public static void main(String[] args) throws Exception {
        new Round173_E().solve();
    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer st;

        public InputReader() throws IOException {
            in = new BufferedReader(new InputStreamReader(System.in));
            st = new StringTokenizer(in.readLine());

        }

        public String next() throws IOException {

            while (!st.hasMoreElements())
                st = new StringTokenizer(in.readLine());
            return st.nextToken();
        }

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

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

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Round173_E {

    class Node {
        Node zero, one;

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

    Node root;

    public void add(Node node, long val, int bit) {
        if (bit == -1)
            return;
        boolean zero = (val & (1L << bit)) == 0;
        if (zero) {
            if (node.zero == null)
                node.zero = new Node();
            add(node.zero, val, bit - 1);
        } else {
            if (node.one == null)
                node.one = new Node();
            add(node.one, val, bit - 1);
        }
    }

    // must add before match query
    public long maxMatch(Node node, long val, int bit) {
        if (bit == -1)
            return 0;
        boolean zero = (val & (1L << bit)) == 0;
        if ((zero && node.one != null)) {
            return (1L << bit) + maxMatch(node.one, val, bit - 1);
        } else if ((!zero && node.zero != null))
            return (1L << bit) + maxMatch(node.zero, val, bit - 1);
        else if (zero)
            return maxMatch(node.zero, val, bit - 1);
        else
            return maxMatch(node.one, val, bit - 1);
    }

    int N;

    public void solve() throws Exception {

        InputReader in = new InputReader();
        N = in.nextInt();
        long[] a = new long[N];
        for (int i = 0; i < N; i++)
            a[i] = in.nextLong();
        long left[] = new long[N];
        left[0] = a[0];
        for (int i = 1; i < N; i++)
            left[i] = a[i] ^ left[i - 1];
        root = new Node();
        long right = 0;
        long ans = left[N - 1];
        for (int i = N - 1; i > -1; i--) {
            right ^= a[i];
            add(root, right, 40);
            ans = Math.max(ans, maxMatch(root, left[i], 40));
        }
        System.out.println(ans);
    }

    public static void main(String[] args) throws Exception {
        new Round173_E().solve();
    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer st;

        public InputReader() throws IOException {
            in = new BufferedReader(new InputStreamReader(System.in));
            st = new StringTokenizer(in.readLine());

        }

        public String next() throws IOException {

            while (!st.hasMoreElements())
                st = new StringTokenizer(in.readLine());
            return st.nextToken();
        }

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

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

}


import java.io.*;
import java.util.*;

public class Main {
    long X;
    long[] pxor;
    long[] s;
    void run() throws Exception{
        int N = nextInt();
        s = new long[N + 1];
        for (int i = 1; i <= N; i++){
            s[i] = nextLong();
        }

        pxor = new long[N + 1];
        for (int i = 1; i <= N; i++){
            pxor[i] = s[i] ^ pxor[i-1];
        }

        X = pxor[N];
        Arrays.sort(pxor);

        int maxl = 0;
        long maxp = pxor[N];
        while (maxp > 0) {
            maxp = maxp >> 1;
            maxl++;
        }

        long [] trie = new long[N + 1];
        long rside = 0;
        long lside;
        int t = -1;
        for (int k = maxl - 1; k >= 0; k--){
            for (int i = 0; i <= N; i++){
                trie[i] = (pxor[i] >> k);
            }
            long K = X >> k;
            int i = 0;
            outer:
            for (i = 0; i <= N; i++){
                lside = trie[i] ^ K ^ ((rside << 1) + 1);
                t = Arrays.binarySearch(trie, lside);
                if (t >= 0) {
                    rside = (rside << 1) + 1;
                    break;
                }
            }
            if(i == N + 1)
                rside = (rside << 1 );
        }
        System.out.println(rside);
    }
    public static void main(String args[]) throws Exception {
            new Main().run(); // read rsideom stdin/stdout
//              new Main("prog.in", "prog.out").run(); // or use file i/o
    }

    BufferedReader in;
    PrintStream out;
    StringTokenizer st;

    Main() throws Exception {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = System.out;
    }

    Main(String is, String os) throws Exception {
            in = new BufferedReader(new FileReader(new File(is)));
            out = new PrintStream(new File(os));
    }

    long nextLong() throws Exception {
            return Long.parseLong(next());
    }
    int nextInt() throws Exception {
            return Integer.parseInt(next());
    }
    String next() throws Exception {
            while (st == null || !st.hasMoreTokens()) {
                    st = new StringTokenizer(in.readLine());
            }
            return st.nextToken();
    }

}


import java.io.*;
import java.util.*;

public class Main {
    long X;
    long[] pxor;
    long[] s;
    void run() throws Exception{
        int N = nextInt();
        s = new long[N + 1];
        for (int i = 1; i <= N; i++){
            s[i] = nextLong();
        }

        pxor = new long[N + 1];
        for (int i = 1; i <= N; i++){
            pxor[i] = s[i] ^ pxor[i-1];
        }

        X = pxor[N];
        Arrays.sort(pxor);

        int maxl = 0;
        long maxp = pxor[N];
        while (maxp > 0) {
            maxp = maxp >> 1;
            maxl++;
        }

        long [] trie = new long[N + 1];
        long rside = 0;
        long lside;
        int t = -1;
        for (int k = maxl - 1; k >= 0; k--){
            for (int i = 0; i <= N; i++){
                trie[i] = (pxor[i] >> k);
            }
            long K = X >> k;
            int i = 0;
            outer:
            for (i = 0; i <= N; i++){
                lside = trie[i] ^ K ^ ((rside << 1) + 1);
                t = Arrays.binarySearch(trie, lside);
                if (t >= 0) {
                    rside = (rside / 2) + 1;
                    break;
                }
            }
            if(i == N + 1)
                rside = (rside/2 );
        }
        System.out.println(rside);
    }
    public static void main(String args[]) throws Exception {
            new Main().run(); // read rsideom stdin/stdout
//              new Main("prog.in", "prog.out").run(); // or use file i/o
    }

    BufferedReader in;
    PrintStream out;
    StringTokenizer st;

    Main() throws Exception {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = System.out;
    }

    Main(String is, String os) throws Exception {
            in = new BufferedReader(new FileReader(new File(is)));
            out = new PrintStream(new File(os));
    }

    long nextLong() throws Exception {
            return Long.parseLong(next());
    }
    int nextInt() throws Exception {
            return Integer.parseInt(next());
    }
    String next() throws Exception {
            while (st == null || !st.hasMoreTokens()) {
                    st = new StringTokenizer(in.readLine());
            }
            return st.nextToken();
    }

}


import java.util.Scanner;

public class Sausage {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long max = nums[0];

		long[] toRight = new long[n+1];
		long[] toLeft = new long[n+1];

		toRight[0] = 0;

		for(int i =1; i<n+1; i++){
			toRight[i] = toRight[i-1]^nums[i-1];
		}

		toLeft[n] = 0;
		for(int i=n-1; i>=0; i--){
			toLeft[i] = toLeft[i+1]^nums[i];
		}

		long maxTot = Integer.MIN_VALUE;

		for(int i = 0; i<n+1; i++){
			for(int j =i; j<n+1; j++){
				maxTot =  Math.max(maxTot, toRight[i]^toLeft[j]);
			}
		}

		System.out.println(maxTot);

	}

}


import java.util.Scanner;

public class Sausage {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long max = nums[0];

		long[] toRight = new long[n+1];
		long[] toLeft = new long[n+1];

		toRight[0] = 0;

		for(int i =1; i<n+1; i++){
			toRight[i] = toRight[i-1]^nums[i-1];
		}

		toLeft[n] = 0;
		for(int i=n-1; i>=0; i--){
			toLeft[i] = toLeft[i+1]^nums[i];
		}

		long maxTot = Integer.MIN_VALUE;

		for(int i = 0; i<n+1; i++){
			for(int j =i+1; j<n+1; j++){
				maxTot =  Math.max(maxTot, toRight[i]^toLeft[j]);
			}
		}

		System.out.println(maxTot);

	}

}


import java.util.Scanner;

public class Sausage {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long max = nums[0];

		long[] toRight = new long[n];
		long act = nums[0];
		for(int i =1; i<n; i++){
			act ^= nums[i];
			max = Math.max(max, act);
		}

		act =  nums[n-1];
		for(int i=n-2; i>=0; i--){
			act ^=nums[i];
			max = Math.max(max, act);
		}

		System.out.println(max);

	}

}


import java.util.Scanner;

public class Sausage {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long max = nums[0];

		long[] toRight = new long[n+1];
		long[] toLeft = new long[n+1];

		toRight[0] = 0;

		for(int i =1; i<n+1; i++){
			toRight[i] = toRight[i-1]^ nums[i-1];
		}

		toLeft[n] = 0;
		for(int i=n-1; i>=0; i--){
			toLeft[i] = toLeft[i+1]^nums[i];
		}

		long maxTot = Integer.MIN_VALUE;
		long maxeach = Integer.MIN_VALUE;

		for(int i = 0; i<n+1; i++){
			if (toRight[i]+toLeft[i] >= maxTot && (toRight[i]>maxeach || toLeft[i]>maxeach)){
				maxTot = toRight[i]+toLeft[i];
				maxeach =  Math.max(toRight[i],toLeft[i]);
			}
		}

		System.out.println(maxeach);

	}

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Sausage {

	static class Trie{
		Trie zero;
		Trie one;

		void add(long n, int bit){
			if (bit<0)return;
			boolean isOne = (n&(1L<<bit))!=0;
			if (isOne){
				if (one==null)
					one = new Trie();
				one.add(n,bit-1);
			} else {
				if (zero==null)
					zero = new Trie();
				zero.add(n, bit-1);
			}
		}

		long get(long n, int bit){
			if (bit<0) return n;
			boolean isOne = (n&(1L<<bit))!=0;
			if(isOne){
				if(one!=null){
					return one.get(n,bit-1);
				} else {
					return zero.get(n&(~(1L<<bit)),bit-1);
				}
			} else {
				if(zero!=null){
					return zero.get(n,bit-1);
				} else {
					return one.get(n|(1L<<bit),bit-1);
				}
			}
		}
	}

	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long[] toRight = new long[n+1];
		long[] toLeft = new long[n+1];

		toRight[0] = 0;
		for(int i =1; i<n+1; i++){
			toRight[i] = toRight[i-1]^nums[i-1];
		}

		Trie t = new Trie();
		int len = 42;

		toLeft[n] = 0;
		for(int i=n-1; i>=0; i--){
			toLeft[i] = toLeft[i+1]^nums[i];
			t.add(toLeft[i], len); //Add toLeft[i+1] to the Trie
		}

		long max = Long.MIN_VALUE;

		for(int i=n; i>=0; i--){
			long close = t.get((toRight[i]^0xFFFFFFFFFFL),len); // Look for the closest to the complement of toRight i in the Trie
			max = Math.max(max, toRight[i]^close);
		}

		System.out.println(max);

	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		public FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return null;
				st = new StringTokenizer(s);
			}
			return st.nextToken();
		}

		boolean hasMoreTokens() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return false;
				st = new StringTokenizer(s);
			}
			return true;
		}

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

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

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


import java.util.Scanner;

public class Sausage {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long max = nums[0];

		long[] toRight = new long[n];
		long act = nums[0];
		for(int i =1; i<n; i++){
			act ^= nums[i];
			max = Math.max(max, act);
		}

		max = Math.max(max, nums[n-1]);
		act =  nums[n-1];
		for(int i=n-2; i>=0; i--){
			act ^=nums[i];
			max = Math.max(max, act);
		}

		System.out.println(max);

	}

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Sausage {

	static class Trie{
		Trie zero;
		Trie one;

		void add(long n, int bit){

			if (bit<0)return;

			boolean isOne = (n&(1<<bit))!=0;
			if (isOne){
				if (one==null){
					one = new Trie();
				}
				one.add(n,bit-1);
			} else {
				if (zero==null){
					zero = new Trie();
				}
				zero.add(n, bit-1);
			}
		}

		long get(long n, int bit){

			if (bit<0) return n;

			boolean isOne = (n&(1<<bit))!=0;

			if(isOne){
				if(one!=null){
					return one.get(n,bit-1);
				} else {
					return zero.get(n&(~(1<<bit)),bit-1);
				}
			} else {
				if(zero!=null){
					return zero.get(n,bit-1);
				} else {
					return one.get(n|(1<<bit),bit-1);
				}
			}
		}

		@Override
		public String toString() {
			return "(" + zero + ", " + one + ")";
		}

	}

	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long[] toRight = new long[n+1];
		long[] toLeft = new long[n+1];

		toRight[0] = 0;

		for(int i =1; i<n+1; i++){
			toRight[i] = toRight[i-1]^nums[i-1];
		}

		toLeft[n] = 0;
		for(int i=n-1; i>=0; i--){
			toLeft[i] = toLeft[i+1]^nums[i];
		}

		long max = Integer.MIN_VALUE;

		Trie t = new Trie();
		int len = 42;

		for(int i=n; i>=0; i--){
			t.add(toLeft[i], len); //Add toLeft[i+1] to the Trie
			long close = t.get(~toRight[i],len); // Look for the closest to the complement of toRight i in the Trie
			max = Math.max(max, toRight[i]^close); // Update the maxTot
		}

		System.out.println(max);

	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		public FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return null;
				st = new StringTokenizer(s);
			}
			return st.nextToken();
		}

		boolean hasMoreTokens() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return false;
				st = new StringTokenizer(s);
			}
			return true;
		}

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

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

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

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Sausage {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long max = nums[0];

		long[] toRight = new long[n+1];
		long[] toLeft = new long[n+1];

		toRight[0] = 0;

		for(int i =1; i<n+1; i++){
			toRight[i] = toRight[i-1]^nums[i-1];
		}

		toLeft[n] = 0;
		for(int i=n-1; i>=0; i--){
			toLeft[i] = toLeft[i+1]^nums[i];
		}

		long maxTot = Integer.MIN_VALUE;

		for(int i = 0; i<n+1; i++){
			for(int j =i; j<n+1; j++){
				maxTot =  Math.max(maxTot, toRight[i]^toLeft[j]);
			}
		}

		System.out.println(maxTot);

	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		public FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return null;
				st = new StringTokenizer(s);
			}
			return st.nextToken();
		}

		boolean hasMoreTokens() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return false;
				st = new StringTokenizer(s);
			}
			return true;
		}

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

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

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

}


import java.util.Scanner;

public class Sausage {

	static class Trie{
		Trie zero;
		Trie one;

		void add(long n, int bit){

			if (bit<0)return;

			boolean isOne = (n&(1L<<bit))!=0;
			if (isOne){
				if (one==null){
					one = new Trie();
				}
				one.add(n,bit-1);
			} else {
				if (zero==null){
					zero = new Trie();
				}
				zero.add(n, bit-1);
			}
		}

		long get(long n, int bit){

			if (bit<0) return n;

			boolean isOne = (n&(1L<<bit))!=0;

			if(isOne){
				if(one!=null){
					return one.get(n,bit-1);
				} else {
					return zero.get(n&(~(1L<<bit)),bit-1);
				}
			} else {
				if(zero!=null){
					return zero.get(n,bit-1);
				} else {
					return one.get(n|(1L<<bit),bit-1);
				}
			}
		}

		@Override
		public String toString() {
			return "(" + zero + ", " + one + ")";
		}

	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long[] toRight = new long[n+1];
		long[] toLeft = new long[n+1];

		toRight[0] = 0;

		for(int i =1; i<n+1; i++){
			toRight[i] = toRight[i-1]^nums[i-1];
		}

		toLeft[n] = 0;
		for(int i=n-1; i>=0; i--){
			toLeft[i] = toLeft[i+1]^nums[i];
		}

		long max = Long.MIN_VALUE;

		Trie t = new Trie();
		int len = 42;

		for(int i=n; i>=0; i--){
			t.add(toLeft[i], len); //Add toLeft[i+1] to the Trie
			long close = t.get((toRight[i]^0xFFFFFFFFFFL),len); // Look for the closest to the complement of toRight i in the Trie
			max = Math.max(max, toRight[i]^close);
		}

		System.out.println(max);

	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Sausage {

	static class Trie{
		Trie zero;
		Trie one;

		void add(long n, int bit){

			if (bit<0)return;

			boolean isOne = (n&(1<<bit))!=0;
			if (isOne){
				if (one==null){
					one = new Trie();
				}
				one.add(n,bit-1);
			} else {
				if (zero==null){
					zero = new Trie();
				}
				zero.add(n, bit-1);
			}
		}

		long get(long n, int bit){

			if (bit<0) return n;

			boolean isOne = (n&(1<<bit))!=0;

			if(isOne){
				if(one!=null){
					return one.get(n,bit-1);
				} else {
					return zero.get(n&(~(1<<bit)),bit-1);
				}
			} else {
				if(zero!=null){
					return zero.get(n,bit-1);
				} else {
					return one.get(n|(1<<bit),bit-1);
				}
			}
		}

		@Override
		public String toString() {
			return "(" + zero + ", " + one + ")";
		}

	}

	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long[] toRight = new long[n+1];
		long[] toLeft = new long[n+1];

		toRight[0] = 0;

		for(int i =1; i<n+1; i++){
			toRight[i] = toRight[i-1]^nums[i-1];
		}

		toLeft[n] = 0;
		for(int i=n-1; i>=0; i--){
			toLeft[i] = toLeft[i+1]^nums[i];
		}

		long max = Integer.MIN_VALUE;

		Trie t = new Trie();
		int len = 46;

		for(int i=n; i>=0; i--){
			t.add(toLeft[i], len); //Add toLeft[i+1] to the Trie
			long close = t.get(~toRight[i],len); // Look for the closest to the complement of toRight i in the Trie
			max = Math.max(max, toRight[i]^close); // Update the maxTot
		}

		System.out.println(max);

	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		public FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return null;
				st = new StringTokenizer(s);
			}
			return st.nextToken();
		}

		boolean hasMoreTokens() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return false;
				st = new StringTokenizer(s);
			}
			return true;
		}

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

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

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

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Sausage {

	static class Trie{
		Trie zero;
		Trie one;

		void add(long n, int bit){

			if (bit<0)return;

			boolean isOne = (n&(1L<<bit))!=0;
			if (isOne){
				if (one==null){
					one = new Trie();
				}
				one.add(n,bit-1);
			} else {
				if (zero==null){
					zero = new Trie();
				}
				zero.add(n, bit-1);
			}
		}

		long get(long n, int bit){

			if (bit<0) return n;

			boolean isOne = (n&(1L<<bit))!=0;

			if(isOne){
				if(one!=null){
					return one.get(n,bit-1);
				} else {
					return zero.get(n&(~(1L<<bit)),bit-1);
				}
			} else {
				if(zero!=null){
					return zero.get(n,bit-1);
				} else {
					return one.get(n|(1L<<bit),bit-1);
				}
			}
		}

		@Override
		public String toString() {
			return "(" + zero + ", " + one + ")";
		}

	}

	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long[] toRight = new long[n+1];
		long[] toLeft = new long[n+1];

		toRight[0] = 0;

		for(int i =1; i<n+1; i++){
			toRight[i] = toRight[i-1]^nums[i-1];
		}

		toLeft[n] = 0;
		for(int i=n-1; i>=0; i--){
			toLeft[i] = toLeft[i+1]^nums[i];
		}

		long max = Long.MIN_VALUE;

		Trie t = new Trie();
		int len = 42;

		for(int i=n; i>=0; i--){
			t.add(toLeft[i], len); //Add toLeft[i+1] to the Trie
			long close = t.get((toRight[i]^0xFFFFFFFFFFL),len); // Look for the closest to the complement of toRight i in the Trie
			max = Math.max(max, toRight[i]^close); // Update the maxTot
		}

		System.out.println(max);

	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		public FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return null;
				st = new StringTokenizer(s);
			}
			return st.nextToken();
		}

		boolean hasMoreTokens() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return false;
				st = new StringTokenizer(s);
			}
			return true;
		}

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

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

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

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Sausage {

	static class Trie{
		Trie zero;
		Trie one;

		void add(long n, int bit){

			if (bit<0)return;

			boolean isOne = (n&(1L<<bit))!=0;
			if (isOne){
				if (one==null){
					one = new Trie();
				}
				one.add(n,bit-1);
			} else {
				if (zero==null){
					zero = new Trie();
				}
				zero.add(n, bit-1);
			}
		}

		long get(long n, int bit){

			if (bit<0) return n;

			boolean isOne = (n&(1L<<bit))!=0;

			if(isOne){
				if(one!=null){
					return one.get(n,bit-1);
				} else {
					return zero.get(n&(~(1L<<bit)),bit-1);
				}
			} else {
				if(zero!=null){
					return zero.get(n,bit-1);
				} else {
					return one.get(n|(1L<<bit),bit-1);
				}
			}
		}

		@Override
		public String toString() {
			return "(" + zero + ", " + one + ")";
		}

	}

	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n];
		for(int i =0; i<n; i++){
			nums[i] = sc.nextLong();
		}

		long[] toRight = new long[n+1];
		long[] toLeft = new long[n+1];

		toRight[0] = 0;

		for(int i =1; i<n+1; i++){
			toRight[i] = toRight[i-1]^nums[i-1];
		}

		toLeft[n] = 0;
		for(int i=n-1; i>=0; i--){
			toLeft[i] = toLeft[i+1]^nums[i];
		}

		long max = Integer.MIN_VALUE;

		Trie t = new Trie();
		int len = 42;

		for(int i=n; i>=0; i--){
			t.add(toLeft[i], len); //Add toLeft[i+1] to the Trie
			long close = t.get(~toRight[i],len); // Look for the closest to the complement of toRight i in the Trie
			max = Math.max(max, toRight[i]^close); // Update the maxTot
		}

		System.out.println(max);

	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		public FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return null;
				st = new StringTokenizer(s);
			}
			return st.nextToken();
		}

		boolean hasMoreTokens() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return false;
				st = new StringTokenizer(s);
			}
			return true;
		}

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

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

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

}


import java.util.Scanner;

public class Round_173_E {

	static class Trie {
		Trie[] edges = new Trie[2];

		void insert(long x) {
			Trie t = this;
			for (int idx = 40; idx >= 0; idx--) {
				int b = (int) (x >> idx & 1);
				if (t.edges[b] == null)
					t.edges[b] = new Trie();
				t = t.edges[b];
			}
		}

		long query(long x) {
			long ans = 0;
			Trie t = this;
			for (int idx = 40; idx >= 0; idx--) {
				int b = (int) (x >> idx & 1);
				long bL = (long) b;
				if (t.edges[b] != null) { // Good match
					ans |= bL << idx;
					t = t.edges[b];
				} else {
					ans |= (bL^1) << idx;
					t = t.edges[b^1];
				}
			}
			return ans;
		}
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] A = new long[n];
		for (int i = 0; i < n; i++)
			A[i] = sc.nextLong();

		Trie t = new Trie();

		long l = 0;
		t.insert(l);
		for (int i = 0; i < n; i++) {
			l ^= A[i];
			t.insert(l);
		}

		long r = 0;
		long mask = 0xffffffffffL;
		long m = r ^ t.query(r ^ mask);
		for (int i = n-1; i >= 0; i--) {
			r ^= A[i];
			m = Math.max(m, r ^ t.query(r ^ mask));
		}

		System.out.println(m);
	}

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Round_173_E {

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		public FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return null;
				st = new StringTokenizer(s);
			}
			return st.nextToken();
		}

		boolean hasMoreTokens() {
			while (st == null || !st.hasMoreTokens()) {
				String s = null;
				try {
					s = br.readLine();
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (s == null)
					return false;
				st = new StringTokenizer(s);
			}
			return true;
		}

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

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

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

	static class Trie {
		Trie[] edges = new Trie[2];

		void insert(long x) {
			Trie t = this;
			for (int idx = 40; idx >= 0; idx--) {
				int b = (int) (x >> idx & 1);
				if (t.edges[b] == null)
					t.edges[b] = new Trie();
				t = t.edges[b];
			}
		}

		long query(long x) {
			long ans = 0;
			Trie t = this;
			for (int idx = 40; idx >= 0; idx--) {
				int b = (int) (x >> idx & 1);
				long bL = (long) b;
				if (t.edges[b] != null) { // Good match
					ans |= bL << idx;
					t = t.edges[b];
				} else {
					ans |= (bL^1) << idx;
					t = t.edges[b^1];
				}
			}
			return ans;
		}
	}

	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int n = sc.nextInt();
		long[] A = new long[n];
		for (int i = 0; i < n; i++)
			A[i] = sc.nextLong();

		Trie t = new Trie();

		long l = 0;
		t.insert(l);
		for (int i = 0; i < n; i++) {
			l ^= A[i];
			t.insert(l);
		}

		long r = 0;
		long mask = 0xffffffffffL;
		long m = r ^ t.query(r ^ mask);
		for (int i = n-1; i >= 0; i--) {
			r ^= A[i];
			m = Math.max(m, r ^ t.query(r ^ mask));
		}

		System.out.println(m);
	}

}


import java.util.Scanner;

public class Round_173_E {

	static class Trie {
		Trie[] edges = new Trie[2];

		void insert(long x, int idx) {
			if (idx < 0)
				return;
			int b = (int) (x >> idx & 1);
			if (edges[b] == null)
				edges[b] = new Trie();
			edges[b].insert(x, idx-1);
		}

		long query(long x, int idx) {
			if (idx < 0)
				return 0;
			int b = (int) (x >> idx & 1);
			long bL = (long) b;
			if (edges[b] != null) { // Good match
				long ans = edges[b].query(x, idx-1);
				return ans | (bL << idx);
			} else {
				long ans = edges[b^1].query(x, idx-1);
				return ans | ((bL^1) << idx);
			}
		}
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] A = new long[n];
		for (int i = 0; i < n; i++)
			A[i] = sc.nextLong();

		int sz = 40;
		Trie t = new Trie();

		long l = 0;
		t.insert(l, sz);
		for (int i = 0; i < n; i++) {
			l ^= A[i];
			t.insert(l, sz);
		}

		long r = 0;
		long mask = 0xffffffffffL;
		long m = r ^ t.query(r ^ mask, sz);
		for (int i = n-1; i >= 0; i--) {
			r ^= A[i];
			m = Math.max(m, r ^ t.query(r ^ mask, sz));
		}

		System.out.println(m);
	}

}


import java.util.Scanner;

public class Round_173_E {

	static class Trie {
		Trie[] edges = new Trie[2];

		void insert(long x, int idx) {
			if (idx < 0)
				return;
			int b = new Integer((int) (x >> idx & 1));
			if (edges[b] == null)
				edges[b] = new Trie();
			edges[b].insert(x, idx-1);
		}

		long query(long x, int idx) {
			if (idx < 0)
				return 0;
			int b = new Integer((int) (x >> idx & 1));
			long bL = (long) b;
			if (edges[b] != null) {
				long ans = edges[b].query(x, idx-1);
				return ans | (bL << idx);
			} else {
				long ans = edges[b^1].query(x, idx-1);
				return ans | ((bL^1) << idx);
			}
		}
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] A = new long[n];
		for (int i = 0; i < n; i++)
			A[i] = sc.nextLong();

		int sz = 40;
		Trie t = new Trie();

		long l = 0;
		t.insert(l, sz);
		for (int i = 0; i < n; i++) {
			l ^= A[i];
			t.insert(l, sz);
		}

		long r = 0;
		long mask = 0xffffffffffL;
		long m = r ^ t.query(r ^ mask, sz);
		for (int i = n-1; i >= 0; i--) {
			r ^= A[i];
			m = Math.max(m, r ^ t.query(r ^ mask, sz));
		}

		System.out.println(m);
	}

}


import java.util.Scanner;

public class Round_173_E {

	static class Trie {
		Trie[] edges = new Trie[2];

		void insert(long x, int idx) {
			if (idx < 0)
				return;
			int b = (int) (x >> idx & 1);
			if (edges[b] == null)
				edges[b] = new Trie();
			edges[b].insert(x, idx-1);
		}

		long query(long x, int idx) {
			if (idx < 0)
				return 0;
			int b = (int) (x >> idx & 1);
			long bL = (long) b;
			if (edges[b] != null) { // Good match
				return (bL << idx) | edges[b].query(x, idx-1);
			} else {
				return ((bL^1) << idx) | edges[b^1].query(x, idx-1);
			}
		}
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] A = new long[n];
		for (int i = 0; i < n; i++)
			A[i] = sc.nextLong();

		int sz = 40;
		Trie t = new Trie();

		long l = 0;
		t.insert(l, sz);
		for (int i = 0; i < n; i++) {
			l ^= A[i];
			t.insert(l, sz);
		}

		long r = 0;
		long mask = 0xffffffffffL;
		long m = r ^ t.query(r ^ mask, sz);
		for (int i = n-1; i >= 0; i--) {
			r ^= A[i];
			m = Math.max(m, r ^ t.query(r ^ mask, sz));
		}

		System.out.println(m);
	}

}


import java.io.*;
import java.util.*;

public class E {

	final String filename = new String("E").toLowerCase();

	void solve() throws Exception {
		int n = nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextLong();
		}

		long[] pref = new long[n + 1];
		long[] suf = new long[n + 1];

		pref[0] = suf[n] = 0;
		for (int i = 0; i < n; i++) {
			pref[i + 1] = a[i] ^ pref[i];
		}

		for (int i = n - 1; i >= 0; i--) {
			suf[i] = suf[i + 1] ^ a[i];
		}

		Arrays.sort(suf);
		long ans = 0;
		for (long x : pref) {

			long mask = 1L << 40;
			long cur = 0;
			for (int bit = 39; bit >= 0; bit--) {
				mask >>>= 1;

				long tmp = cur;
				if ((x & mask) == 0) {
					tmp |= mask;
				}

				int id = Arrays.binarySearch(suf, tmp);
				if (id < 0) {
					id = (-id - 1);
					if (id > n || Long.highestOneBit(suf[id] ^ tmp) >= mask) {
						tmp ^= mask;
					}
				}
				cur = tmp;
			}
			ans = Math.max(ans, cur ^ x);
		}

		out.println(ans);
	}

	public void run() {
		try {
			// in = new BufferedReader(new FileReader("gen.out"));
			// out = new PrintWriter("output.txt");
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();

			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() throws Exception {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws Exception {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws Exception {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws Exception {
		return Double.parseDouble(nextToken());
	}

	public static void main(String[] args) {
		new E().run();
	}

}


import java.io.*;
import java.util.*;

public class E {

	final String filename = new String("E").toLowerCase();

	void solve() throws Exception {
		int n = nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextLong();
		}

		long[] pref = new long[n + 1];
		long[] suf = new long[n + 1];

		pref[0] = suf[n] = 0;
		for (int i = 0; i < n; i++) {
			pref[i + 1] = a[i] ^ pref[i];
		}

		for (int i = n - 1; i >= 0; i--) {
			suf[i] = suf[i + 1] ^ a[i];
		}

		Arrays.sort(suf);
		long ans = 0;
		for (long x : pref) {

			long mask = 1L << 40;
			long cur = 0;
			for (int bit = 39; bit >= 0; bit--) {
				mask >>>= 1;

				long tmp = cur;
				if ((x & mask) == 0) {
					tmp |= mask;
				}

				int id = Arrays.binarySearch(suf, tmp);
				if (id < 0) {
					id = (-id - 1);
				}
				if (id > n || (suf[id] & tmp) != tmp) {
					tmp ^= mask;
				}
				cur = tmp;
			}
			ans = Math.max(ans, cur ^ x);
		}

		out.println(ans);
	}

	public void run() {
		try {
			// in = new BufferedReader(new FileReader("gen.out"));
			// out = new PrintWriter("output.txt");
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();

			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() throws Exception {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws Exception {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws Exception {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws Exception {
		return Double.parseDouble(nextToken());
	}

	public static void main(String[] args) {
		new E().run();
	}

}


import java.io.*;
import java.util.*;

public class E {

	final String filename = new String("E").toLowerCase();

	void solve() throws Exception {
		int n = nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextLong();
		}

		long[] pref = new long[n + 1];
		long[] suf = new long[n + 1];

		pref[0] = suf[n] = 0;
		for (int i = 0; i < n; i++) {
			pref[i + 1] = a[i] ^ pref[i];
		}

		for (int i = n - 1; i >= 0; i--) {
			suf[i] = suf[i + 1] ^ a[i];
		}

		Arrays.sort(suf);
		long ans = 0;
		for (long x : pref) {

			long mask = 1L << 40;
			long cur = 0;
			for (int bit = 39; bit >= 0; bit--) {
				mask >>>= 1;

				long tmp = cur;
				if ((x & mask) == 0) {
					tmp |= mask;
				}

				int id = Arrays.binarySearch(suf, tmp);
				if (id < 0) {
					id = (-id - 1);
					if (id > n || (suf[id] & tmp) != tmp) {
						tmp ^= mask;
					}
				}
				cur = tmp;
			}
			ans = Math.max(ans, cur ^ x);
		}

		out.println(ans);
	}

	public void run() {
		try {
			// in = new BufferedReader(new FileReader("gen.out"));
			// out = new PrintWriter("output.txt");
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();

			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() throws Exception {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws Exception {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws Exception {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws Exception {
		return Double.parseDouble(nextToken());
	}

	public static void main(String[] args) {
		new E().run();
	}

}


import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class E {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n = in.readInt();
        long[] A = new long[n];
        long pre = 0;
        for (int i = 0; i < n; i++)
            pre ^= A[i] = in.readLong();
        long suf = 0;
        long ans = pre;
        Trie T = new Trie();
        for (int i = n - 1; i >= 0; i--) {
            suf ^= A[i];
            pre ^= A[i];
            T.insert(suf);
            long v = T.search(pre);
            ans = Math.max(ans, pre ^ v);
        }
        System.out.println(ans);
    }
}

class Trie {
    Trie[] next;

    public Trie() {
        next = new Trie[2];
    }

    public void insert(long x) {
        insert(x, 40);
    }

    private void insert(long x, int bit) {
        if (bit == -1)
            return;
        int current = (x & (1l << bit)) == 0 ? 0 : 1;
        if (next[current] == null)
            next[current] = new Trie();
        next[current].insert(x, bit - 1);
    }

    public long search(long x) {
        return search(x, 40);
    }

    private long search(long x, int bit) {
        if (bit == 0)
            return 0;
        int current = (x & (1l << bit)) == 0 ? 1 : 0;
        if (next[current] != null)
            return ((long) current << bit) | next[current].search(x, bit - 1);
        else
            return ((long) (1 - current) << bit)
                    | next[current ^ 1].search(x, bit - 1);
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1000];
    private int curChar, numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    private int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    private boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class E {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n = in.readInt();
        long[] A = new long[n];
        long pre = 0;
        for (int i = 0; i < n; i++)
            pre ^= A[i] = in.readLong();
        long suf = 0;
        long ans = pre;
        Trie T = new Trie();
        for (int i = n - 1; i >= 0; i--) {
            suf ^= A[i];
            pre ^= A[i];
            T.insert(suf);
            long v = T.search(pre);
            ans = Math.max(ans, pre ^ v);
        }
        System.out.println(ans);
    }
}

class Trie {
    Trie[] next;

    public Trie() {
        next = new Trie[2];
    }

    public void insert(long x) {
        insert(x, 40);
    }

    private void insert(long x, int bit) {
        if (bit == -1)
            return;
        int current = (x & (1l << bit)) == 0 ? 0 : 1;
        if (next[current] == null)
            next[current] = new Trie();
        next[current].insert(x, bit - 1);
    }

    public long search(long x) {
        return search(x, 40);
    }

    private long search(long x, int bit) {
        if (bit == -1)
            return 0;
        int current = (x & (1l << bit)) == 0 ? 1 : 0;
        if (next[current] != null)
            return ((long) current << bit) | next[current].search(x, bit - 1);
        else
            return ((long) (1 - current) << bit)
                    | next[current ^ 1].search(x, bit - 1);
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1000];
    private int curChar, numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    private int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    private boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class E {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n = in.readInt();
        long[] A = new long[n];
        long pre = 0;
        for (int i = 0; i < n; i++)
            pre ^= A[i] = in.readLong();
        long suf = 0;
        long ans = pre;
        Trie T = new Trie();
        T.insert(0);
        for (int i = n - 1; i >= 0; i--) {
            suf ^= A[i];
            pre ^= A[i];
            T.insert(suf);
            long v = T.search(pre);
            ans = Math.max(ans, pre ^ v);
        }
        System.out.println(ans);
    }
}

class Trie {
    Trie[] next;

    public Trie() {
        next = new Trie[2];
    }

    public void insert(long x) {
        insert(x, 40);
    }

    private void insert(long x, int bit) {
        if (bit == -1)
            return;
        int current = (x & (1l << bit)) == 0 ? 0 : 1;
        if (next[current] == null)
            next[current] = new Trie();
        next[current].insert(x, bit - 1);
    }

    public long search(long x) {
        return search(x, 40);
    }

    private long search(long x, int bit) {
        if (bit == -1)
            return 0;
        int current = (x & (1l << bit)) == 0 ? 1 : 0;
        if (next[current] != null)
            return ((long) current << bit) | next[current].search(x, bit - 1);
        else
            return ((long) (1 - current) << bit)
                    | next[current ^ 1].search(x, bit - 1);
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1000];
    private int curChar, numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    private int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    private boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class E {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n = in.readInt();
        long[] A = new long[n];
        long pre = 0;
        for (int i = 0; i < n; i++)
            pre ^= A[i] = in.readLong();
        long suf = 0;
        long ans = pre;
        Trie T = new Trie();
        for (int i = n - 1; i >= 0; i--) {
            suf ^= A[i];
            pre ^= A[i];
            T.insert(suf);
            long v = T.search(pre);
            ans = Math.max(ans, pre ^ v);
        }
        System.out.println(ans);
    }
}

class Trie {
    Trie[] next;

    public Trie() {
        next = new Trie[2];
    }

    public void insert(long x) {
        insert(x, 40);
    }

    private void insert(long x, int bit) {
        if (bit == -1)
            return;
        int current = (x & (1l << bit)) == 0 ? 0 : 1;
        if (next[current] == null)
            next[current] = new Trie();
        next[current].insert(x, bit - 1);
    }

    public long search(long x) {
        return search(x, 40);
    }

    private long search(long x, int bit) {
        if (bit == 0)
            return 0;
        int current = (x & (1l << bit)) == 0 ? 1 : 0;
        if (next[current] != null)
            return (1l << bit) | next[current].search(x, bit - 1);
        else
            return next[current ^ 1].search(x, bit - 1);
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1000];
    private int curChar, numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    private int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    private boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuffer buf = new StringBuffer();
        int c = read();
        while (c != '\n' && c != -1) {
            buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }
}


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.StringTokenizer;

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*=2;
				result+=dig[i];
			}

			return result;
		}
	}

	public void Run() throws NumberFormatException, IOException {
		//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];
		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.StringTokenizer;

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=64;

	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*=2;
				result+=dig[i];
			}

			return result;
		}
	}

	public void Run() throws NumberFormatException, IOException {
		//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];
		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();
	}

}