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

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

	public static long MOD = 1000000007;

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

		}
		long pre = 0;

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

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

		}
		out.println(result);

		out.close();
	}

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

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

	}

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

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

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

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

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

	}

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

	}

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

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

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

	}

	public static class Point implements Comparable<Point> {

		int x, y;

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

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

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

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

	public static class FT {

		long[] data;

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

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

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

		}
	}

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

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

		}
	}

	static class Scanner {

		BufferedReader br;
		StringTokenizer st;

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

		public String next() {

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

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

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

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

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

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


import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.StringTokenizer;

public class CF173D2E implements CodeforcesSolver {

	public void solve(InputStream is) {
		FastScanner in = new FastScanner(is);
		int n = in.nextInt();
		long[] a = new long[n];
		for(int i : Range.zeroTo(n))
			a[i] = in.nextLong();

		long left = xorAll(a);
		long right = 0;
		long max = 0;
		Trie<Boolean> trie = Trie.create();
		trie.add(tobools(0));
		for(int i=n; i>= 0; i--) {
			TrieNode<Boolean> cur = trie.getRoot();
			long best = 0;
			for(int j=63;j>=0;j--) {
				boolean leftbit = (left & (1L<<j)) > 0; // TODO LongBitUtil?? ??????.
				boolean prefer = !leftbit;
				if(cur.hasChild(prefer)) {
					cur = cur.getChild(prefer);
					best |= (1<<j);
				} else {
					cur = cur.getChild(!prefer);
				}
			}
//			System.out.println("L " + left);
//			System.out.println(trie);
			max = Math.max(max, best);

			if(i-1 >= 0) {
				left ^= a[i-1];
				right ^= a[i-1];
				trie.add(tobools(right));
			}
		}
		System.out.println(max);
	}

	private long xorAll(long[] a) {
		long r = 0;
		for(long v : a)
			r ^= v;
		return r;
	}

	private MutableArrayUsingBooleanArray tobools(long right) {
		boolean[] r = new boolean[64];
		for(int j=63;j>=0;j--)
			r[63-j] = (right & (1L<<j)) > 0;
		return new MutableArrayUsingBooleanArray(r);
	}

	public static void main(String[] args) throws Exception {
		CodeforcesSolverLauncher.launch(new CodeforcesSolverFactory() {
			public CodeforcesSolver create() {
				return new CF173D2E();
			}
		}, "E1.txt", "E2.txt", "E3.txt", "E4.txt");
	}

}

interface CodeforcesSolver {
	void solve(InputStream is);
}

interface CodeforcesSolverFactory {
	CodeforcesSolver create();
}

class CodeforcesSolverLauncher {

	public static void launch(CodeforcesSolverFactory factory, String... inputFilePath) throws FileNotFoundException, IOException {
		if(System.getProperty("ONLINE_JUDGE", "false").equals("true")) {
			factory.create().solve(System.in);
		} else {
			for(String path : inputFilePath) {
				FileInputStream is = new FileInputStream(new File(path));
				factory.create().solve(is);
				is.close();
				System.out.println();
			}
		}
	}

}

class FastScanner {

	private StringTokenizer tokenizer;

	public FastScanner(InputStream is) {
		try {
			ByteArrayOutputStream bos = new ByteArrayOutputStream(10*1024*1024);
			byte[] buf = new byte[1024*1024];
			while(true) {
				int read = is.read(buf);
				if(read == -1)
					break;
				bos.write(buf, 0, read);
			}
			tokenizer = new StringTokenizer(new String(bos.toByteArray()));
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

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

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

	public String next() {
		return tokenizer.nextToken();
	}

}

class Range {

	public static Iterable<Integer> zeroTo(int end) {
		return fromTo(0, end);
	}

	public static Iterable<Integer> fromTo(int begin, int end) {
		return IntSequenceIterable.create(begin, 1, end-begin);
	}

}

class IntSequenceIterable {
	public static Iterable<Integer> create(final int from, final int step, final int size) {
		return new Iterable<Integer>() {
			public Iterator<Integer> iterator() {
				return new ReadOnlyIterator<Integer>() {
					int nextIndex = 0;
					public boolean hasNext() {
						return nextIndex < size;
					}
					public Integer next() {
						return from + step * (nextIndex++);
					}
				};
			}
		};
	}
}

abstract class ReadOnlyIterator<T> implements Iterator<T> {
	public final void remove() {
		throw new UnsupportedOperationException();
	}
}

class MutableArrayUsingBooleanArray implements MutableArray<Boolean> {

	// TODO static createor�� �ٲٱ�.

	private final boolean[] a;
	private final int n;

	public MutableArrayUsingBooleanArray(boolean[] a) {
		this.a = a;
		n = a.length;
	}

	public MutableArrayUsingBooleanArray(boolean[] a, int n) {
		this.a = a;
		this.n = n;
	}

	public Boolean get(int i) {
		return a[i];
	}

	public void set(int i, Boolean v) {
		a[i] = v;
	}

	public int size() {
		return n;
	}

	public final boolean isEmpty() {
		return size() == 0;
	}

	public final Iterator<Boolean> iterator() {
		return ArrayIterator.create(this);
	}

	public final String toString() {
		return IterableToString.toString(this);
	}

}

class IterableToString {
	public static <T> String toString(Iterable<T> iterable) {
		StringBuilder sb = new StringBuilder();
		sb.append('(');
		boolean first = true;
		for(T v : iterable) {
			if(first)
				first = false;
			else
				sb.append(',');
			sb.append(v);
		}
		sb.append(')');
		return sb.toString();
	}
}

class ArrayIterator {
	public static <T> Iterator<T> create(final Array<T> a) {
		return new ReadOnlyIterator<T>() {
			int p = 0;
			public boolean hasNext() {
				return p < a.size();
			}
			public T next() {
				return a.get(p++);
			}
		};
	}
}

interface Array<T> extends Collection<T> {
	T get(int index);
}

interface Collection<T> extends Iterable<T> {
	int size();
	boolean isEmpty();
}

interface MutableArray<T> extends Array<T> {
	void set(int index, T value);
}

class Trie<T> {

	public static <T> Trie<T> create() {
		return new Trie<T>();
	}

	private final TrieNode<T> root = TrieNode.create();

	public void add(Iterable<T> sequence) {
		TrieNode<T> cur = root;
		for(T v : sequence) {
			TrieNode<T> subTrie = cur.getChild(v, null);
			if(subTrie == null) {
				subTrie = TrieNode.create();
				cur.putChild(v, subTrie);
			}
			cur = subTrie;
		}
	}

	public TrieNode<T> getRoot() {
		return root;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		toString(root, 0, sb);
		return sb.toString();
	}

	private void toString(TrieNode<T> node, int level, StringBuilder sb) {
		for(T c : node.getEdges()) {
			for(@SuppressWarnings("unused") int i : Range.zeroTo(level))
				sb.append(" ");
			sb.append(c + "\n");
			toString(node.getChild(c), level+1, sb);
		}
	}

}

class TrieNode<T> {

	public static <T> TrieNode<T> create() {
		return new TrieNode<T>();
	}

	private final MutableMap<T, TrieNode<T>> children = new JavaHashMapFactory().create();

	public boolean hasChild(T ch) {
		return children.containsKey(ch);
	}

	public TrieNode<T> getChild(T ch, TrieNode<T> def) {
		if(children.containsKey(ch))
			return children.get(ch);
		else
			return def;
	}

	public void putChild(T ch, TrieNode<T> node) {
		children.put(ch, node);
	}

	public int getChildCount() {
		return children.size();
	}

	public TrieNode<T> getChild(T ch) {
		return children.get(ch);
	}

	public Iterable<T> getEdges() {
		return children.keys();
	}

}

class JavaHashMapFactory implements MutableMapFactory {

	public <K, V> MutableMap<K, V> create() {
		return new MutableMapWrapperForJavaMap<K, V>(new HashMap<K, V>());
	}

}

interface MutableMap<K, V> extends Collection<MutableEntry<K, V>> {
	// TODO ���������̽� �̱�.
	void clear();
	void put(K key, V value);
	void remove(K key);
	boolean containsKey(K key);
	V get(K key);
	Iterable<V> values();
	Iterable<K> keys();
}

interface MutableEntry<K, V> {
	// TODO �̰͵� �׳� Entry�� �־�� �ұ�?
	K getKey();
	V getValue();
	void setValue(V v);
}

interface MutableMapFactory {
	<K,V> MutableMap<K,V> create();
}

class MutableMapWrapperForJavaMap<K, V> implements MutableMap<K, V> {

	private final java.util.Map<K,V> map;

	public MutableMapWrapperForJavaMap(java.util.Map<K,V> map) {
		this.map = map;
	}

	public boolean containsKey(K key) {
		return map.containsKey(key);
	}

	public V get(K key) {
		return map.get(key);
	}

	public Iterable<K> keys() {
		return map.keySet();
	}

	public void put(K key, V value) {
		map.put(key, value);
	}

	public Iterable<V> values() {
		return map.values();
	}

	public void clear() {
		map.clear();
	}

	public boolean isEmpty() {
		return map.isEmpty();
	}

	public Iterator<MutableEntry<K, V>> iterator() {
		return ConvertedDataIterator.create(map.entrySet().iterator(), new DataConverter<java.util.Map.Entry<K,V>, MutableEntry<K,V>>() {
			public MutableEntry<K, V> convert(java.util.Map.Entry<K, V> e) {
				return new EntryWrapper<K, V>(e);
			}
		});
	}

	public int size() {
		return map.size();
	}

	public void remove(K key) {
		map.remove(key);
	}

	public String toString() {
		return map.toString();
	}

	private static class EntryWrapper<K, V> implements MutableEntry<K, V>, EqualityTester<EntryWrapper<K,V>> {
		private java.util.Map.Entry<K, V> e;
		private EntryWrapper(java.util.Map.Entry<K, V> e) {
			this.e = e;
		}
		public K getKey() {
			return e.getKey();
		}
		public V getValue() {
			return e.getValue();
		}
		public void setValue(V v) {
			e.setValue(v);
		}
		public boolean equals(Object obj) {
			return StrictEqualityTester.areEqual(this, obj, this);
		}
		public boolean areEqual(EntryWrapper<K, V> o1, EntryWrapper<K, V> o2) {
			return o1.getKey().equals(o2.getKey()) && o1.getValue().equals(o2.getValue());
		}
		public int hashCode() {
			return PairHash.hash(getKey().hashCode(), getValue().hashCode());
		}
	}

}

class ConvertedDataIterator {
	public static <T1, T2> Iterator<T2> create(final Iterator<T1> original, final DataConverter<T1, T2> converter) {
		return new ReadOnlyIterator<T2>() {
			public boolean hasNext() {
				return original.hasNext();
			}
			public T2 next() {
				return converter.convert(original.next());
			}
		};
	}
}

interface DataConverter<T1, T2> {
	T2 convert(T1 v);
}

interface EqualityTester<T> {
	boolean areEqual(T o1, T o2);
}

class StrictEqualityTester {
	@SuppressWarnings("unchecked")
	public static <T> boolean areEqual(T me, Object you, EqualityTester<T> tester) {
		if(me == you)
			return true;
		if(you == null)
			return false;
		if(you.getClass() != me.getClass())
			return false;
		return tester.areEqual(me, (T)you);
	}
}

class PairHash {
	public static int hash(int h1, int h2) {
		return ThomasWangHash.hash64bit((((long) h1) << 32) | h2);
	}
}

class ThomasWangHash {

	// from http://www.concentric.net/~ttwang/tech/inthash.htm

	public static int hash32bit(int key) {
		key = ~key + (key << 15); // key = (key << 15) - key - 1;
		key = key ^ (key >>> 12);
		key = key + (key << 2);
		key = key ^ (key >>> 4);
		key = key * 2057; // key = (key + (key << 3)) + (key << 11);
		key = key ^ (key >>> 16);
		return key;
	}

	public static int hash64bit(long key) {
		key = (~key) + (key << 18); // key = (key << 18) - key - 1;
		key = key ^ (key >>> 31);
		key = key * 21; // key = (key + (key << 2)) + (key << 4);
		key = key ^ (key >>> 11);
		key = key + (key << 6);
		key = key ^ (key >>> 22);
		return (int) key;
	}
}


import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.Random;
import java.util.StringTokenizer;

public class CF173D2E implements CodeforcesSolver {

	public void solve(InputStream is) {
		FastScanner in = new FastScanner(is);
		int n = in.nextInt();
		long[] a = new long[n];
		for(int i : Range.zeroTo(n))
			a[i] = in.nextLong();

//		n = 100000;
//		a = new long[n];
//		for(int i : Range.zeroTo(n))
//			a[i] = new Random().nextLong() % 1000000000000L;

		long left = xorAll(a);
		long right = 0;
		long max = 0;
		final MutableMapFactoryForOneKeyType<Boolean> mf = MutableMapFactoryForBooleanKey.create();
		Trie<Boolean> trie = new Trie<Boolean>(new TrieNodeFactory<Boolean>() {
			public TrieNode<Boolean> create() {
				return new TrieNode<Boolean>() {
					TrieNode<Boolean> zero, one;
					public void putChild(Boolean ch, TrieNode<Boolean> node) {
						if(ch)
							one = node;
						else
							zero = node;
					}
					public boolean hasChild(Boolean ch) {
						if(ch)
							return one != null;
						else
							return zero != null;
					}
					public Iterable<Boolean> getEdges() {
						throw new RuntimeException();
					}
					public int getChildCount() {
						throw new RuntimeException();
					}
					public TrieNode<Boolean> getChild(Boolean ch) {
						if(ch)
							return one;
						else
							return zero;
					}
					public TrieNode<Boolean> getChild(Boolean ch, TrieNode<Boolean> def) {
						TrieNode<Boolean> r = getChild(ch);
						if(r != null)
							return r;
						else
							return def;
					}
				};
			}
		});
		trie.add(toarray(0));
		for(int i=n; i>= 0; i--) {
			TrieNode<Boolean> cur = trie.getRoot();
			long best = 0;
			for(int j=63;j>=0;j--) {
				boolean leftbit = (left & (1L<<j)) > 0; // TODO LongBitUtil?? ??????.
				boolean prefer = !leftbit;
				if(cur.hasChild(prefer)) {
					cur = cur.getChild(prefer);
					best |= (1L<<j);
				} else {
					cur = cur.getChild(!prefer);
				}
			}
//			System.out.println("L " + left);
//			System.out.println(trie);
			max = Math.max(max, best);

			if(i-1 >= 0) {
				left ^= a[i-1];
				right ^= a[i-1];
				Array<Boolean> array = toarray(right);
				trie.add(array);
			}
		}
		System.out.println(max);
	}

	private long xorAll(long[] a) {
		long r = 0;
		for(long v : a)
			r ^= v;
		return r;
	}

	private Array<Boolean> toarray(long right) {
		Boolean[] r = new Boolean[64];
		for(int j=63;j>=0;j--)
			r[63-j] = (right & (1L<<j)) > 0;
		return new MutableArrayUsingJavaArray(r);
	}

	public static void main(String[] args) throws Exception {
		CodeforcesSolverLauncher.launch(new CodeforcesSolverFactory() {
			public CodeforcesSolver create() {
				return new CF173D2E();
			}
		}, "E1.txt", "E2.txt", "E3.txt", "E4.txt");
	}

}

interface CodeforcesSolver {
	void solve(InputStream is);
}

interface CodeforcesSolverFactory {
	CodeforcesSolver create();
}

class CodeforcesSolverLauncher {

	public static void launch(CodeforcesSolverFactory factory, String... inputFilePath) throws FileNotFoundException, IOException {
		if(System.getProperty("ONLINE_JUDGE", "false").equals("true")) {
			factory.create().solve(System.in);
		} else {
			for(String path : inputFilePath) {
				FileInputStream is = new FileInputStream(new File(path));
				factory.create().solve(is);
				is.close();
				System.out.println();
			}
		}
	}

}

class FastScanner {

	private StringTokenizer tokenizer;

	public FastScanner(InputStream is) {
		try {
			ByteArrayOutputStream bos = new ByteArrayOutputStream(1024*1024);
			byte[] buf = new byte[1024*1024];
			while(true) {
				int read = is.read(buf);
				if(read == -1)
					break;
				bos.write(buf, 0, read);
			}
			tokenizer = new StringTokenizer(new String(bos.toByteArray()));
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

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

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

	public String next() {
		return tokenizer.nextToken();
	}

}

class Range {

	public static Iterable<Integer> zeroTo(int end) {
		return fromTo(0, end);
	}

	public static Iterable<Integer> fromTo(int begin, int end) {
		return IntSequenceIterable.create(begin, 1, end-begin);
	}

}

class IntSequenceIterable {
	public static Iterable<Integer> create(final int from, final int step, final int size) {
		return new Iterable<Integer>() {
			public Iterator<Integer> iterator() {
				return new ReadOnlyIterator<Integer>() {
					int nextIndex = 0;
					public boolean hasNext() {
						return nextIndex < size;
					}
					public Integer next() {
						return from + step * (nextIndex++);
					}
				};
			}
		};
	}
}

abstract class ReadOnlyIterator<T> implements Iterator<T> {
	public final void remove() {
		throw new UnsupportedOperationException();
	}
}

interface Array<T> extends Collection<T> {
	T get(int index);
}

interface Collection<T> extends Iterable<T> {
	int size();
	boolean isEmpty();
}

interface MutableMapFactoryForOneKeyType<K> {
	<V> MutableMap<K, V> create();
}

interface MutableMap<K, V> extends Collection<MutableEntry<K, V>> {
	// TODO ���������̽� �̱�.
	void clear();
	void put(K key, V value);
	void remove(K key);
	boolean containsKey(K key);
	V get(K key);
	V get(K key, V def);
	Iterable<V> values();
	Iterable<K> keys();
}

interface MutableEntry<K, V> {
	// TODO �̰͵� �׳� Entry�� �־�� �ұ�?
	K getKey();
	V getValue();
	void setValue(V v);
}

class MutableArrayUsingJavaArray<T> implements MutableArray<T> {
	// TODO �̸��ٲٱ� ArrayUsingJavaArray staticarray~�� �����ϴ°ŵ� �� �ٲ���.

	final private T[] a;
	final private int start;
	final private int end;

	public MutableArrayUsingJavaArray(T[] a) {
		this.a = a;
		start = 0;
		end = a.length-1;
	}

	public MutableArrayUsingJavaArray(T[] a, int start, int end) {
		this.a = a;
		this.start = start;
		this.end = end;
	}

	public MutableArrayUsingJavaArray(T[] a, int n) {
		this.a = a;
		this.start = 0;
		this.end = n-1;
	}

	public T get(int arg0) {
		return a[start+arg0];
	}

	public void set(int arg0, T arg1) {
		a[start+arg0] = arg1;
	}

	public int size() {
		return end-start+1;
	}

	public final boolean isEmpty() {
		return size() == 0;
	}

	public final Iterator<T> iterator() {
		return ArrayIterator.create(this);
	}

	public final String toString() {
		return IterableToString.toString(this);
	}

}

class IterableToString {
	public static <T> String toString(Iterable<T> iterable) {
		StringBuilder sb = new StringBuilder();
		sb.append('(');
		boolean first = true;
		for(T v : iterable) {
			if(first)
				first = false;
			else
				sb.append(',');
			sb.append(v);
		}
		sb.append(')');
		return sb.toString();
	}
}

class ArrayIterator {
	public static <T> Iterator<T> create(final Array<T> a) {
		return new ReadOnlyIterator<T>() {
			int p = 0;
			public boolean hasNext() {
				return p < a.size();
			}
			public T next() {
				return a.get(p++);
			}
		};
	}
}

interface MutableArray<T> extends Array<T> {
	void set(int index, T value);
}

class MutableMapFactoryForBooleanKey {

	public static MutableMapFactoryForOneKeyType<Boolean> create() {
		return new MutableMapFactoryForOneKeyType<Boolean>() {
			public <T> MutableMap<Boolean, T> create() {
				return new MutableMap<Boolean, T>() {
					T falseValue = null;
					T trueValue = null;
					public void clear() {
						falseValue = null;
						trueValue= null;
					}
					public boolean containsKey(Boolean key) {
						if(key)
							return trueValue != null;
						else
							return falseValue != null;
					}
					public T get(Boolean key) {
						T r = get(key, null);
						if(r == null)
							throw new RuntimeException();
						return r;
					}
					public T get(Boolean key, T def) {
						T r;
						if(key)
							r = trueValue;
						else
							r = falseValue;
						if(r != null)
							return r;
						else
							return def;
					}
					public boolean isEmpty() {
						return trueValue == null && falseValue != null;
					}
					public Iterator<MutableEntry<Boolean, T>> iterator() {
						return ConvertedDataIterable.create(keys(), new DataConverter<Boolean, MutableEntry<Boolean, T>>() {
							public MutableEntry<Boolean, T> convert(final Boolean key) {
								return new MutableEntry<Boolean, T>() {
									public Boolean getKey() {
										return key;
									}
									public T getValue() {
										return get(key);
									}
									public void setValue(T value) {
										put(key, value);
									}
								};
							}
						}).iterator();
					}
					public Iterable<Boolean> keys() {
						return FilteringIterable.create(ArrayIterable.create(false, true), new DataFilter<Boolean>() {
							public boolean isAccepted(Boolean v) {
								if(v)
									return trueValue != null;
								else
									return falseValue != null;
							}
						});
					}
					public int size() {
						return (trueValue!=null?1:0) + (falseValue!=null?1:0);
					}
					public void put(Boolean key, T value) {
						if(key)
							trueValue = value;
						else
							falseValue = value;
					}
					public void remove(Boolean key) {
						put(key, null);
					}
					public Iterable<T> values() {
						return ConvertedDataIterable.create(keys(), new DataConverter<Boolean, T>() {
							public T convert(final Boolean key) {
								return get(key);
							}
						});
					}
				};
			}
		};
	}

}

class ConvertedDataIterable {

	public static <T1, T2> Iterable<T2> create(final Iterable<T1> outerIterable, final DataConverter<T1, T2> converter) {
		return new Iterable<T2>() {
			public Iterator<T2> iterator() {
				return ConvertedDataIterator.create(outerIterable.iterator(), converter);
			}
		};
	}
}

class ConvertedDataIterator {
	public static <T1, T2> Iterator<T2> create(final Iterator<T1> original, final DataConverter<T1, T2> converter) {
		return new ReadOnlyIterator<T2>() {
			public boolean hasNext() {
				return original.hasNext();
			}
			public T2 next() {
				return converter.convert(original.next());
			}
		};
	}
}

interface DataConverter<T1, T2> {
	T2 convert(T1 v);
}

interface DataFilter<T> {
	boolean isAccepted(T v);
}

class FilteringIterable {

	public static <T> Iterable<T> create(final Iterable<? extends T> original, final DataFilter<T> filter) {
		return new Iterable<T>() {
			public Iterator<T> iterator() {
				return new ReadOnlyIterator<T>() {

					Iterator<? extends T> cursor = original.iterator();
					boolean hasNext = false;
					T next;

					public boolean hasNext() {
						ensureNext();
						return hasNext;
					}

					public T next() {
						ensureNext();
						hasNext = false;
						return next;
					}

					private void ensureNext() {
						if(!hasNext) {
							while(cursor.hasNext()) {
								T value = cursor.next();
								if(filter.isAccepted(value)) {
									next = value;
									hasNext = true;
									break;
								}
							}
						}
					}
				};
			}
		};
	}
}

class ArrayIterable {

	public static <T> Iterable<T> create(final T... data) {
		return ConvertedDataIterable.create(Range.zeroTo(data.length), new DataConverter<Integer, T>() {
			public T convert(Integer v) {
				return data[v];
			}
		});
	}

}

class Trie<T> {

	private TrieNodeFactory<T> nodeFactory;

	private final TrieNode<T> root;

	public Trie(TrieNodeFactory<T> nodeFactory) {
		this.nodeFactory = nodeFactory;
		root = nodeFactory.create();
	}

	public void add(Iterable<T> sequence) {
		TrieNode<T> cur = root;
		for(T v : sequence) {
			TrieNode<T> subTrie = cur.getChild(v, null);
			if(subTrie == null) {
				subTrie = nodeFactory.create();
				cur.putChild(v, subTrie);
			}
			cur = subTrie;
		}
	}

	public TrieNode<T> getRoot() {
		return root;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		toString(root, 0, sb);
		return sb.toString();
	}

	private void toString(TrieNode<T> node, int level, StringBuilder sb) {
		for(T c : node.getEdges()) {
			for(@SuppressWarnings("unused") int i : Range.zeroTo(level))
				sb.append(" ");
			sb.append(c + "\n");
			toString(node.getChild(c), level+1, sb);
		}
	}

}

interface TrieNode<T> {
	int getChildCount();
	boolean hasChild(T ch);
	TrieNode<T> getChild(T ch, TrieNode<T> def);
	TrieNode<T> getChild(T ch);
	Iterable<T> getEdges();
	void putChild(T ch, TrieNode<T> node);
}

interface TrieNodeFactory<T> {
	TrieNode<T> create();
}


import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.Random;
import java.util.StringTokenizer;

public class CF173D2E implements CodeforcesSolver {

	public void solve(InputStream is) {
		FastScanner in = new FastScanner(is);
		int n = in.nextInt();
		long[] a = new long[n];
		for(int i : Range.zeroTo(n))
			a[i] = in.nextLong();

		n = 100000;
		a = new long[n];
		for(int i : Range.zeroTo(n))
			a[i] = new Random().nextLong() % 1000000000000L;

		long left = xorAll(a);
		long right = 0;
		long max = 0;
		Trie<Boolean> trie = new Trie<Boolean>(null, MutableMapFactoryForBooleanKey.create());
		trie.add(toarray(0));
		for(int i=n; i>= 0; i--) {
			TrieNode<Boolean> cur = trie.getRoot();
			long best = 0;
			for(int j=63;j>=0;j--) {
				boolean leftbit = (left & (1L<<j)) > 0; // TODO LongBitUtil?? ??????.
				boolean prefer = !leftbit;
				if(cur.hasChild(prefer)) {
					cur = cur.getChild(prefer);
					best |= (1L<<j);
				} else {
					cur = cur.getChild(!prefer);
				}
			}
//			System.out.println("L " + left);
//			System.out.println(trie);
			max = Math.max(max, best);

			if(i-1 >= 0) {
				left ^= a[i-1];
				right ^= a[i-1];
				Array<Boolean> array = toarray(right);
				trie.add(array);
			}
		}
		System.out.println(max);
	}

	private long xorAll(long[] a) {
		long r = 0;
		for(long v : a)
			r ^= v;
		return r;
	}

	private Array<Boolean> toarray(long right) {
		Boolean[] r = new Boolean[64];
		for(int j=63;j>=0;j--)
			r[63-j] = (right & (1L<<j)) > 0;
		return new MutableArrayUsingJavaArray(r);
	}

	public static void main(String[] args) throws Exception {
		CodeforcesSolverLauncher.launch(new CodeforcesSolverFactory() {
			public CodeforcesSolver create() {
				return new CF173D2E();
			}
		}, "E1.txt", "E2.txt", "E3.txt", "E4.txt");
	}

}

interface CodeforcesSolver {
	void solve(InputStream is);
}

interface CodeforcesSolverFactory {
	CodeforcesSolver create();
}

class CodeforcesSolverLauncher {

	public static void launch(CodeforcesSolverFactory factory, String... inputFilePath) throws FileNotFoundException, IOException {
		if(System.getProperty("ONLINE_JUDGE", "false").equals("true")) {
			factory.create().solve(System.in);
		} else {
			for(String path : inputFilePath) {
				FileInputStream is = new FileInputStream(new File(path));
				factory.create().solve(is);
				is.close();
				System.out.println();
			}
		}
	}

}

class FastScanner {

	private StringTokenizer tokenizer;

	public FastScanner(InputStream is) {
		try {
			ByteArrayOutputStream bos = new ByteArrayOutputStream(1024*1024);
			byte[] buf = new byte[1024*1024];
			while(true) {
				int read = is.read(buf);
				if(read == -1)
					break;
				bos.write(buf, 0, read);
			}
			tokenizer = new StringTokenizer(new String(bos.toByteArray()));
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

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

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

	public String next() {
		return tokenizer.nextToken();
	}

}

class Range {

	public static Iterable<Integer> zeroTo(int end) {
		return fromTo(0, end);
	}

	public static Iterable<Integer> fromTo(int begin, int end) {
		return IntSequenceIterable.create(begin, 1, end-begin);
	}

}

class IntSequenceIterable {
	public static Iterable<Integer> create(final int from, final int step, final int size) {
		return new Iterable<Integer>() {
			public Iterator<Integer> iterator() {
				return new ReadOnlyIterator<Integer>() {
					int nextIndex = 0;
					public boolean hasNext() {
						return nextIndex < size;
					}
					public Integer next() {
						return from + step * (nextIndex++);
					}
				};
			}
		};
	}
}

abstract class ReadOnlyIterator<T> implements Iterator<T> {
	public final void remove() {
		throw new UnsupportedOperationException();
	}
}

interface Array<T> extends Collection<T> {
	T get(int index);
}

interface Collection<T> extends Iterable<T> {
	int size();
	boolean isEmpty();
}

class MutableArrayUsingJavaArray<T> implements MutableArray<T> {
	// TODO �̸��ٲٱ� ArrayUsingJavaArray staticarray~�� �����ϴ°ŵ� �� �ٲ���.

	final private T[] a;
	final private int start;
	final private int end;

	public MutableArrayUsingJavaArray(T[] a) {
		this.a = a;
		start = 0;
		end = a.length-1;
	}

	public MutableArrayUsingJavaArray(T[] a, int start, int end) {
		this.a = a;
		this.start = start;
		this.end = end;
	}

	public MutableArrayUsingJavaArray(T[] a, int n) {
		this.a = a;
		this.start = 0;
		this.end = n-1;
	}

	public T get(int arg0) {
		return a[start+arg0];
	}

	public void set(int arg0, T arg1) {
		a[start+arg0] = arg1;
	}

	public int size() {
		return end-start+1;
	}

	public final boolean isEmpty() {
		return size() == 0;
	}

	public final Iterator<T> iterator() {
		return ArrayIterator.create(this);
	}

	public final String toString() {
		return IterableToString.toString(this);
	}

}

class IterableToString {
	public static <T> String toString(Iterable<T> iterable) {
		StringBuilder sb = new StringBuilder();
		sb.append('(');
		boolean first = true;
		for(T v : iterable) {
			if(first)
				first = false;
			else
				sb.append(',');
			sb.append(v);
		}
		sb.append(')');
		return sb.toString();
	}
}

class ArrayIterator {
	public static <T> Iterator<T> create(final Array<T> a) {
		return new ReadOnlyIterator<T>() {
			int p = 0;
			public boolean hasNext() {
				return p < a.size();
			}
			public T next() {
				return a.get(p++);
			}
		};
	}
}

interface MutableArray<T> extends Array<T> {
	void set(int index, T value);
}

class MutableMapFactoryForBooleanKey {

	public static MutableMapFactoryForOneKeyType<Boolean> create() {
		return new MutableMapFactoryForOneKeyType<Boolean>() {
			public <V> MutableMap<Boolean, V> create() {
				return new MutableMap<Boolean, V>() {
					V falseValue = null;
					V trueValue = null;
					public void clear() {
						falseValue = null;
						trueValue= null;
					}
					public boolean containsKey(Boolean key) {
						if(key)
							return trueValue != null;
						else
							return falseValue != null;
					}
					public V get(Boolean key) {
						V r = get(key, null);
						if(r == null)
							throw new RuntimeException();
						return r;
					}
					public V get(Boolean key, V def) {
						V r;
						if(key)
							r = trueValue;
						else
							r = falseValue;
						if(r != null)
							return r;
						else
							return def;
					}
					public boolean isEmpty() {
						return trueValue == null && falseValue != null;
					}
					public Iterator<MutableEntry<Boolean, V>> iterator() {
						return ConvertedDataIterable.create(keys(), new DataConverter<Boolean, MutableEntry<Boolean, V>>() {
							public MutableEntry<Boolean, V> convert(final Boolean key) {
								return new MutableEntry<Boolean, V>() {
									public Boolean getKey() {
										return key;
									}
									public V getValue() {
										return get(key);
									}
									public void setValue(V value) {
										put(key, value);
									}
								};
							}
						}).iterator();
					}
					public Iterable<Boolean> keys() {
						return FilteringIterable.create(ArrayIterable.create(false, true), new DataFilter<Boolean>() {
							public boolean isAccepted(Boolean v) {
								if(v)
									return trueValue != null;
								else
									return falseValue != null;
							}
						});
					}
					public int size() {
						return (trueValue!=null?1:0) + (falseValue!=null?1:0);
					}
					public void put(Boolean key, V value) {
						if(key)
							trueValue = value;
						else
							falseValue = value;
					}
					public void remove(Boolean key) {
						put(key, null);
					}
					public Iterable<V> values() {
						return ConvertedDataIterable.create(keys(), new DataConverter<Boolean, V>() {
							public V convert(final Boolean key) {
								return get(key);
							}
						});
					}
				};
			}
		};
	}

}

class ConvertedDataIterable {

	public static <T1, T2> Iterable<T2> create(final Iterable<T1> outerIterable, final DataConverter<T1, T2> converter) {
		return new Iterable<T2>() {
			public Iterator<T2> iterator() {
				return ConvertedDataIterator.create(outerIterable.iterator(), converter);
			}
		};
	}
}

class ConvertedDataIterator {
	public static <T1, T2> Iterator<T2> create(final Iterator<T1> original, final DataConverter<T1, T2> converter) {
		return new ReadOnlyIterator<T2>() {
			public boolean hasNext() {
				return original.hasNext();
			}
			public T2 next() {
				return converter.convert(original.next());
			}
		};
	}
}

interface DataConverter<T1, T2> {
	T2 convert(T1 v);
}

interface DataFilter<T> {
	boolean isAccepted(T v);
}

class FilteringIterable {

	public static <T> Iterable<T> create(final Iterable<? extends T> original, final DataFilter<T> filter) {
		return new Iterable<T>() {
			public Iterator<T> iterator() {
				return new ReadOnlyIterator<T>() {

					Iterator<? extends T> cursor = original.iterator();
					boolean hasNext = false;
					T next;

					public boolean hasNext() {
						ensureNext();
						return hasNext;
					}

					public T next() {
						ensureNext();
						hasNext = false;
						return next;
					}

					private void ensureNext() {
						if(!hasNext) {
							while(cursor.hasNext()) {
								T value = cursor.next();
								if(filter.isAccepted(value)) {
									next = value;
									hasNext = true;
									break;
								}
							}
						}
					}
				};
			}
		};
	}
}

class ArrayIterable {

	public static <T> Iterable<T> create(final T... data) {
		return ConvertedDataIterable.create(Range.zeroTo(data.length), new DataConverter<Integer, T>() {
			public T convert(Integer v) {
				return data[v];
			}
		});
	}

}

interface MutableEntry<K, V> {
	// TODO �̰͵� �׳� Entry�� �־�� �ұ�?
	K getKey();
	V getValue();
	void setValue(V v);
}

interface MutableMap<K, V> extends Collection<MutableEntry<K, V>> {
	// TODO ���������̽� �̱�.
	void clear();
	void put(K key, V value);
	void remove(K key);
	boolean containsKey(K key);
	V get(K key);
	V get(K key, V def);
	Iterable<V> values();
	Iterable<K> keys();
}

interface MutableMapFactoryForOneKeyType<K> {
	<V> MutableMap<K, V> create();
}

class Trie<T> {

	private TrieNodeFactory<T> nodeFactory;
	private MutableMapFactoryForOneKeyType<T> mapFactory;

	private final TrieNode<T> root;

	public Trie(TrieNodeFactory<T> nodeFactory, MutableMapFactoryForOneKeyType<T> mapFactory) {
		this.nodeFactory = nodeFactory;
		this.mapFactory = mapFactory;
		root = new GenericTrieNode<T>(mapFactory);
	}

	public void add(Iterable<T> sequence) {
		TrieNode<T> cur = root;
		for(T v : sequence) {
			TrieNode<T> subTrie = cur.getChild(v, null);
			if(subTrie == null) {
				subTrie = new GenericTrieNode<T>(mapFactory);
				cur.putChild(v, subTrie);
			}
			cur = subTrie;
		}
	}

	public TrieNode<T> getRoot() {
		return root;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		toString(root, 0, sb);
		return sb.toString();
	}

	private void toString(TrieNode<T> node, int level, StringBuilder sb) {
		for(T c : node.getEdges()) {
			for(@SuppressWarnings("unused") int i : Range.zeroTo(level))
				sb.append(" ");
			sb.append(c + "\n");
			toString(node.getChild(c), level+1, sb);
		}
	}

}

class GenericTrieNode<T> implements TrieNode<T> {

	private final MutableMap<T, TrieNode<T>> children;

	public GenericTrieNode(MutableMapFactoryForOneKeyType<T> mapFactory) {
		children = mapFactory.create();
	}

	public boolean hasChild(T ch) {
		return children.containsKey(ch);
	}

	public TrieNode<T> getChild(T ch, TrieNode<T> def) {
		TrieNode<T> r = children.get(ch, null);
		if(r != null)
			return r;
		else
			return def;
	}

	public void putChild(T ch, TrieNode<T> node) {
		children.put(ch, node);
	}

	public int getChildCount() {
		return children.size();
	}

	public TrieNode<T> getChild(T ch) {
		return children.get(ch);
	}

	public Iterable<T> getEdges() {
		return children.keys();
	}

}

interface TrieNode<T> {
	int getChildCount();
	boolean hasChild(T ch);
	TrieNode<T> getChild(T ch, TrieNode<T> def);
	TrieNode<T> getChild(T ch);
	Iterable<T> getEdges();
	void putChild(T ch, TrieNode<T> node);
}

interface TrieNodeFactory<T> {
	TrieNode<T> create();
}


import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.Random;
import java.util.StringTokenizer;

public class CF173D2E implements CodeforcesSolver {

	public void solve(InputStream is) {
		FastScanner in = new FastScanner(is);
		int n = in.nextInt();
		long[] a = new long[n];
		for(int i : Range.zeroTo(n))
			a[i] = in.nextLong();

		n = 100000;
		a = new long[n];
		for(int i : Range.zeroTo(n))
			a[i] = new Random().nextLong() % 1000000000000L;

		long left = xorAll(a);
		long right = 0;
		long max = 0;
		final MutableMapFactoryForOneKeyType<Boolean> mf = MutableMapFactoryForBooleanKey.create();
		Trie<Boolean> trie = new Trie<Boolean>(new TrieNodeFactory<Boolean>() {
			public TrieNode<Boolean> create() {
				return new TrieNode<Boolean>() {
					TrieNode<Boolean> zero, one;
					public void putChild(Boolean ch, TrieNode<Boolean> node) {
						if(ch)
							one = node;
						else
							zero = node;
					}
					public boolean hasChild(Boolean ch) {
						if(ch)
							return one != null;
						else
							return zero != null;
					}
					public Iterable<Boolean> getEdges() {
						throw new RuntimeException();
					}
					public int getChildCount() {
						throw new RuntimeException();
					}
					public TrieNode<Boolean> getChild(Boolean ch) {
						if(ch)
							return one;
						else
							return zero;
					}
					public TrieNode<Boolean> getChild(Boolean ch, TrieNode<Boolean> def) {
						TrieNode<Boolean> r = getChild(ch);
						if(r != null)
							return r;
						else
							return def;
					}
				};
			}
		});
		trie.add(toarray(0));
		for(int i=n; i>= 0; i--) {
			TrieNode<Boolean> cur = trie.getRoot();
			long best = 0;
			for(int j=63;j>=0;j--) {
				boolean leftbit = (left & (1L<<j)) > 0; // TODO LongBitUtil?? ??????.
				boolean prefer = !leftbit;
				if(cur.hasChild(prefer)) {
					cur = cur.getChild(prefer);
					best |= (1L<<j);
				} else {
					cur = cur.getChild(!prefer);
				}
			}
//			System.out.println("L " + left);
//			System.out.println(trie);
			max = Math.max(max, best);

			if(i-1 >= 0) {
				left ^= a[i-1];
				right ^= a[i-1];
				Array<Boolean> array = toarray(right);
				trie.add(array);
			}
		}
		System.out.println(max);
	}

	private long xorAll(long[] a) {
		long r = 0;
		for(long v : a)
			r ^= v;
		return r;
	}

	private Array<Boolean> toarray(long right) {
		Boolean[] r = new Boolean[64];
		for(int j=63;j>=0;j--)
			r[63-j] = (right & (1L<<j)) > 0;
		return new MutableArrayUsingJavaArray(r);
	}

	public static void main(String[] args) throws Exception {
		CodeforcesSolverLauncher.launch(new CodeforcesSolverFactory() {
			public CodeforcesSolver create() {
				return new CF173D2E();
			}
		}, "E1.txt", "E2.txt", "E3.txt", "E4.txt");
	}

}

interface CodeforcesSolver {
	void solve(InputStream is);
}

interface CodeforcesSolverFactory {
	CodeforcesSolver create();
}

class CodeforcesSolverLauncher {

	public static void launch(CodeforcesSolverFactory factory, String... inputFilePath) throws FileNotFoundException, IOException {
		if(System.getProperty("ONLINE_JUDGE", "false").equals("true")) {
			factory.create().solve(System.in);
		} else {
			for(String path : inputFilePath) {
				FileInputStream is = new FileInputStream(new File(path));
				factory.create().solve(is);
				is.close();
				System.out.println();
			}
		}
	}

}

class FastScanner {

	private StringTokenizer tokenizer;

	public FastScanner(InputStream is) {
		try {
			ByteArrayOutputStream bos = new ByteArrayOutputStream(1024*1024);
			byte[] buf = new byte[1024*1024];
			while(true) {
				int read = is.read(buf);
				if(read == -1)
					break;
				bos.write(buf, 0, read);
			}
			tokenizer = new StringTokenizer(new String(bos.toByteArray()));
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

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

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

	public String next() {
		return tokenizer.nextToken();
	}

}

class Range {

	public static Iterable<Integer> zeroTo(int end) {
		return fromTo(0, end);
	}

	public static Iterable<Integer> fromTo(int begin, int end) {
		return IntSequenceIterable.create(begin, 1, end-begin);
	}

}

class IntSequenceIterable {
	public static Iterable<Integer> create(final int from, final int step, final int size) {
		return new Iterable<Integer>() {
			public Iterator<Integer> iterator() {
				return new ReadOnlyIterator<Integer>() {
					int nextIndex = 0;
					public boolean hasNext() {
						return nextIndex < size;
					}
					public Integer next() {
						return from + step * (nextIndex++);
					}
				};
			}
		};
	}
}

abstract class ReadOnlyIterator<T> implements Iterator<T> {
	public final void remove() {
		throw new UnsupportedOperationException();
	}
}

interface Array<T> extends Collection<T> {
	T get(int index);
}

interface Collection<T> extends Iterable<T> {
	int size();
	boolean isEmpty();
}

interface MutableMapFactoryForOneKeyType<K> {
	<V> MutableMap<K, V> create();
}

interface MutableMap<K, V> extends Collection<MutableEntry<K, V>> {
	// TODO ���������̽� �̱�.
	void clear();
	void put(K key, V value);
	void remove(K key);
	boolean containsKey(K key);
	V get(K key);
	V get(K key, V def);
	Iterable<V> values();
	Iterable<K> keys();
}

interface MutableEntry<K, V> {
	// TODO �̰͵� �׳� Entry�� �־�� �ұ�?
	K getKey();
	V getValue();
	void setValue(V v);
}

class MutableArrayUsingJavaArray<T> implements MutableArray<T> {
	// TODO �̸��ٲٱ� ArrayUsingJavaArray staticarray~�� �����ϴ°ŵ� �� �ٲ���.

	final private T[] a;
	final private int start;
	final private int end;

	public MutableArrayUsingJavaArray(T[] a) {
		this.a = a;
		start = 0;
		end = a.length-1;
	}

	public MutableArrayUsingJavaArray(T[] a, int start, int end) {
		this.a = a;
		this.start = start;
		this.end = end;
	}

	public MutableArrayUsingJavaArray(T[] a, int n) {
		this.a = a;
		this.start = 0;
		this.end = n-1;
	}

	public T get(int arg0) {
		return a[start+arg0];
	}

	public void set(int arg0, T arg1) {
		a[start+arg0] = arg1;
	}

	public int size() {
		return end-start+1;
	}

	public final boolean isEmpty() {
		return size() == 0;
	}

	public final Iterator<T> iterator() {
		return ArrayIterator.create(this);
	}

	public final String toString() {
		return IterableToString.toString(this);
	}

}

class IterableToString {
	public static <T> String toString(Iterable<T> iterable) {
		StringBuilder sb = new StringBuilder();
		sb.append('(');
		boolean first = true;
		for(T v : iterable) {
			if(first)
				first = false;
			else
				sb.append(',');
			sb.append(v);
		}
		sb.append(')');
		return sb.toString();
	}
}

class ArrayIterator {
	public static <T> Iterator<T> create(final Array<T> a) {
		return new ReadOnlyIterator<T>() {
			int p = 0;
			public boolean hasNext() {
				return p < a.size();
			}
			public T next() {
				return a.get(p++);
			}
		};
	}
}

interface MutableArray<T> extends Array<T> {
	void set(int index, T value);
}

class MutableMapFactoryForBooleanKey {

	public static MutableMapFactoryForOneKeyType<Boolean> create() {
		return new MutableMapFactoryForOneKeyType<Boolean>() {
			public <T> MutableMap<Boolean, T> create() {
				return new MutableMap<Boolean, T>() {
					T falseValue = null;
					T trueValue = null;
					public void clear() {
						falseValue = null;
						trueValue= null;
					}
					public boolean containsKey(Boolean key) {
						if(key)
							return trueValue != null;
						else
							return falseValue != null;
					}
					public T get(Boolean key) {
						T r = get(key, null);
						if(r == null)
							throw new RuntimeException();
						return r;
					}
					public T get(Boolean key, T def) {
						T r;
						if(key)
							r = trueValue;
						else
							r = falseValue;
						if(r != null)
							return r;
						else
							return def;
					}
					public boolean isEmpty() {
						return trueValue == null && falseValue != null;
					}
					public Iterator<MutableEntry<Boolean, T>> iterator() {
						return ConvertedDataIterable.create(keys(), new DataConverter<Boolean, MutableEntry<Boolean, T>>() {
							public MutableEntry<Boolean, T> convert(final Boolean key) {
								return new MutableEntry<Boolean, T>() {
									public Boolean getKey() {
										return key;
									}
									public T getValue() {
										return get(key);
									}
									public void setValue(T value) {
										put(key, value);
									}
								};
							}
						}).iterator();
					}
					public Iterable<Boolean> keys() {
						return FilteringIterable.create(ArrayIterable.create(false, true), new DataFilter<Boolean>() {
							public boolean isAccepted(Boolean v) {
								if(v)
									return trueValue != null;
								else
									return falseValue != null;
							}
						});
					}
					public int size() {
						return (trueValue!=null?1:0) + (falseValue!=null?1:0);
					}
					public void put(Boolean key, T value) {
						if(key)
							trueValue = value;
						else
							falseValue = value;
					}
					public void remove(Boolean key) {
						put(key, null);
					}
					public Iterable<T> values() {
						return ConvertedDataIterable.create(keys(), new DataConverter<Boolean, T>() {
							public T convert(final Boolean key) {
								return get(key);
							}
						});
					}
				};
			}
		};
	}

}

class ConvertedDataIterable {

	public static <T1, T2> Iterable<T2> create(final Iterable<T1> outerIterable, final DataConverter<T1, T2> converter) {
		return new Iterable<T2>() {
			public Iterator<T2> iterator() {
				return ConvertedDataIterator.create(outerIterable.iterator(), converter);
			}
		};
	}
}

class ConvertedDataIterator {
	public static <T1, T2> Iterator<T2> create(final Iterator<T1> original, final DataConverter<T1, T2> converter) {
		return new ReadOnlyIterator<T2>() {
			public boolean hasNext() {
				return original.hasNext();
			}
			public T2 next() {
				return converter.convert(original.next());
			}
		};
	}
}

interface DataConverter<T1, T2> {
	T2 convert(T1 v);
}

interface DataFilter<T> {
	boolean isAccepted(T v);
}

class FilteringIterable {

	public static <T> Iterable<T> create(final Iterable<? extends T> original, final DataFilter<T> filter) {
		return new Iterable<T>() {
			public Iterator<T> iterator() {
				return new ReadOnlyIterator<T>() {

					Iterator<? extends T> cursor = original.iterator();
					boolean hasNext = false;
					T next;

					public boolean hasNext() {
						ensureNext();
						return hasNext;
					}

					public T next() {
						ensureNext();
						hasNext = false;
						return next;
					}

					private void ensureNext() {
						if(!hasNext) {
							while(cursor.hasNext()) {
								T value = cursor.next();
								if(filter.isAccepted(value)) {
									next = value;
									hasNext = true;
									break;
								}
							}
						}
					}
				};
			}
		};
	}
}

class ArrayIterable {

	public static <T> Iterable<T> create(final T... data) {
		return ConvertedDataIterable.create(Range.zeroTo(data.length), new DataConverter<Integer, T>() {
			public T convert(Integer v) {
				return data[v];
			}
		});
	}

}

class Trie<T> {

	private TrieNodeFactory<T> nodeFactory;

	private final TrieNode<T> root;

	public Trie(TrieNodeFactory<T> nodeFactory) {
		this.nodeFactory = nodeFactory;
		root = nodeFactory.create();
	}

	public void add(Iterable<T> sequence) {
		TrieNode<T> cur = root;
		for(T v : sequence) {
			TrieNode<T> subTrie = cur.getChild(v, null);
			if(subTrie == null) {
				subTrie = nodeFactory.create();
				cur.putChild(v, subTrie);
			}
			cur = subTrie;
		}
	}

	public TrieNode<T> getRoot() {
		return root;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		toString(root, 0, sb);
		return sb.toString();
	}

	private void toString(TrieNode<T> node, int level, StringBuilder sb) {
		for(T c : node.getEdges()) {
			for(@SuppressWarnings("unused") int i : Range.zeroTo(level))
				sb.append(" ");
			sb.append(c + "\n");
			toString(node.getChild(c), level+1, sb);
		}
	}

}

interface TrieNode<T> {
	int getChildCount();
	boolean hasChild(T ch);
	TrieNode<T> getChild(T ch, TrieNode<T> def);
	TrieNode<T> getChild(T ch);
	Iterable<T> getEdges();
	void putChild(T ch, TrieNode<T> node);
}

interface TrieNodeFactory<T> {
	TrieNode<T> create();
}


import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.StringTokenizer;

public class CF173D2E implements CodeforcesSolver {

//	@Override
	public void solve1(InputStream is) {
		FastScanner in = new FastScanner(is);
		int n = in.nextInt();
		long[] a = new long[n];
		for(int i : Range.zeroTo(n))
			a[i] = in.nextInt();

		long max = 0;

		long left = 0;
		for(int i : Range.zeroTo(n)) {
			left ^= a[i];
			long right = 0;
			for(int j=n-1; j>i; j--) {
				right ^= a[j];

				long r = left ^ right;
				if(r == 15)
					System.out.println(r + " " + i + " " + j);
				max = Math.max(max, r);
			}
		}
		System.out.println(max);
	}

//	@Override
	public void solve(InputStream is) {
		FastScanner in = new FastScanner(is);
		int n = in.nextInt();
		long[] a = new long[n];
		for(int i : Range.zeroTo(n))
			a[i] = in.nextInt();

		long left = xorAll(a);
		long right = 0;
		long max = 0;
		Trie<Boolean> trie = Trie.create();
		trie.add(tobools(0));
		for(int i=n; i>= 0; i--) {
			TrieNode<Boolean> cur = trie.getRoot();
			long best = 0;
			for(int j=63;j>=0;j--) {
				boolean leftbit = (left & (1L<<j)) > 0; // TODO LongBitUtil?? ??????.
				boolean prefer = !leftbit;
				if(cur.hasChild(prefer)) {
					cur = cur.getChild(prefer);
					best |= (1<<j);
				} else {
					cur = cur.getChild(!prefer);
				}
			}
//			System.out.println("L " + left);
//			System.out.println(trie);
			max = Math.max(max, best);

			if(i-1 >= 0) {
				left ^= a[i-1];
				right ^= a[i-1];
				trie.add(tobools(right));
			}
		}
		System.out.println(max);
	}

	private long xorAll(long[] a) {
		long r = 0;
		for(long v : a)
			r ^= v;
		return r;
	}

	private MutableArrayUsingBooleanArray tobools(long right) {
		boolean[] r = new boolean[64];
		for(int j=63;j>=0;j--)
			r[63-j] = (right & (1L<<j)) > 0;
		return new MutableArrayUsingBooleanArray(r);
	}

	public static void main(String[] args) throws Exception {
		CodeforcesSolverLauncher.launch(new CodeforcesSolverFactory() {
			public CodeforcesSolver create() {
				return new CF173D2E();
			}
		}, "E1.txt", "E2.txt", "E3.txt", "E4.txt");
	}

}

interface CodeforcesSolver {
	void solve(InputStream is);
}

interface CodeforcesSolverFactory {
	CodeforcesSolver create();
}

class CodeforcesSolverLauncher {

	public static void launch(CodeforcesSolverFactory factory, String... inputFilePath) throws FileNotFoundException, IOException {
		if(System.getProperty("ONLINE_JUDGE", "false").equals("true")) {
			factory.create().solve(System.in);
		} else {
			for(String path : inputFilePath) {
				FileInputStream is = new FileInputStream(new File(path));
				factory.create().solve(is);
				is.close();
				System.out.println();
			}
		}
	}

}

class FastScanner {

	private StringTokenizer tokenizer;

	public FastScanner(InputStream is) {
		try {
			ByteArrayOutputStream bos = new ByteArrayOutputStream(10*1024*1024);
			byte[] buf = new byte[1024*1024];
			while(true) {
				int read = is.read(buf);
				if(read == -1)
					break;
				bos.write(buf, 0, read);
			}
			tokenizer = new StringTokenizer(new String(bos.toByteArray()));
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

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

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

	public String next() {
		return tokenizer.nextToken();
	}

}

class Range {

	public static Iterable<Integer> zeroTo(int end) {
		return fromTo(0, end);
	}

	public static Iterable<Integer> fromTo(int begin, int end) {
		return IntSequenceIterable.create(begin, 1, end-begin);
	}

}

class IntSequenceIterable {
	public static Iterable<Integer> create(final int from, final int step, final int size) {
		return new Iterable<Integer>() {
			public Iterator<Integer> iterator() {
				return new ReadOnlyIterator<Integer>() {
					int nextIndex = 0;
					public boolean hasNext() {
						return nextIndex < size;
					}
					public Integer next() {
						return from + step * (nextIndex++);
					}
				};
			}
		};
	}
}

abstract class ReadOnlyIterator<T> implements Iterator<T> {
	public final void remove() {
		throw new UnsupportedOperationException();
	}
}

class MutableArrayUsingBooleanArray implements MutableArray<Boolean> {

	// TODO static createor�� �ٲٱ�.

	private final boolean[] a;
	private final int n;

	public MutableArrayUsingBooleanArray(boolean[] a) {
		this.a = a;
		n = a.length;
	}

	public MutableArrayUsingBooleanArray(boolean[] a, int n) {
		this.a = a;
		this.n = n;
	}

	public Boolean get(int i) {
		return a[i];
	}

	public void set(int i, Boolean v) {
		a[i] = v;
	}

	public int size() {
		return n;
	}

	public final boolean isEmpty() {
		return size() == 0;
	}

	public final Iterator<Boolean> iterator() {
		return ArrayIterator.create(this);
	}

	public final String toString() {
		return IterableToString.toString(this);
	}

}

class IterableToString {
	public static <T> String toString(Iterable<T> iterable) {
		StringBuilder sb = new StringBuilder();
		sb.append('(');
		boolean first = true;
		for(T v : iterable) {
			if(first)
				first = false;
			else
				sb.append(',');
			sb.append(v);
		}
		sb.append(')');
		return sb.toString();
	}
}

class ArrayIterator {
	public static <T> Iterator<T> create(final Array<T> a) {
		return new ReadOnlyIterator<T>() {
			int p = 0;
			public boolean hasNext() {
				return p < a.size();
			}
			public T next() {
				return a.get(p++);
			}
		};
	}
}

interface Array<T> extends Collection<T> {
	T get(int index);
}

interface Collection<T> extends Iterable<T> {
	int size();
	boolean isEmpty();
}

interface MutableArray<T> extends Array<T> {
	void set(int index, T value);
}

class Trie<T> {

	public static <T> Trie<T> create() {
		return new Trie<T>();
	}

	private final TrieNode<T> root = TrieNode.create();

	public void add(Iterable<T> sequence) {
		TrieNode<T> cur = root;
		for(T v : sequence) {
			TrieNode<T> subTrie = cur.getChild(v, null);
			if(subTrie == null) {
				subTrie = TrieNode.create();
				cur.putChild(v, subTrie);
			}
			cur = subTrie;
		}
	}

	public TrieNode<T> getRoot() {
		return root;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		toString(root, 0, sb);
		return sb.toString();
	}

	private void toString(TrieNode<T> node, int level, StringBuilder sb) {
		for(T c : node.getEdges()) {
			for(@SuppressWarnings("unused") int i : Range.zeroTo(level))
				sb.append(" ");
			sb.append(c + "\n");
			toString(node.getChild(c), level+1, sb);
		}
	}

}

class TrieNode<T> {

	public static <T> TrieNode<T> create() {
		return new TrieNode<T>();
	}

	private final MutableMap<T, TrieNode<T>> children = new JavaHashMapFactory().create();

	public boolean hasChild(T ch) {
		return children.containsKey(ch);
	}

	public TrieNode<T> getChild(T ch, TrieNode<T> def) {
		if(children.containsKey(ch))
			return children.get(ch);
		else
			return def;
	}

	public void putChild(T ch, TrieNode<T> node) {
		children.put(ch, node);
	}

	public int getChildCount() {
		return children.size();
	}

	public TrieNode<T> getChild(T ch) {
		return children.get(ch);
	}

	public Iterable<T> getEdges() {
		return children.keys();
	}

}

class JavaHashMapFactory implements MutableMapFactory {

	public <K, V> MutableMap<K, V> create() {
		return new MutableMapWrapperForJavaMap<K, V>(new HashMap<K, V>());
	}

}

interface MutableMap<K, V> extends Collection<MutableEntry<K, V>> {
	// TODO ���������̽� �̱�.
	void clear();
	void put(K key, V value);
	void remove(K key);
	boolean containsKey(K key);
	V get(K key);
	Iterable<V> values();
	Iterable<K> keys();
}

interface MutableEntry<K, V> {
	// TODO �̰͵� �׳� Entry�� �־�� �ұ�?
	K getKey();
	V getValue();
	void setValue(V v);
}

interface MutableMapFactory {
	<K,V> MutableMap<K,V> create();
}

class MutableMapWrapperForJavaMap<K, V> implements MutableMap<K, V> {

	private final java.util.Map<K,V> map;

	public MutableMapWrapperForJavaMap(java.util.Map<K,V> map) {
		this.map = map;
	}

	public boolean containsKey(K key) {
		return map.containsKey(key);
	}

	public V get(K key) {
		return map.get(key);
	}

	public Iterable<K> keys() {
		return map.keySet();
	}

	public void put(K key, V value) {
		map.put(key, value);
	}

	public Iterable<V> values() {
		return map.values();
	}

	public void clear() {
		map.clear();
	}

	public boolean isEmpty() {
		return map.isEmpty();
	}

	public Iterator<MutableEntry<K, V>> iterator() {
		return ConvertedDataIterator.create(map.entrySet().iterator(), new DataConverter<java.util.Map.Entry<K,V>, MutableEntry<K,V>>() {
			public MutableEntry<K, V> convert(java.util.Map.Entry<K, V> e) {
				return new EntryWrapper<K, V>(e);
			}
		});
	}

	public int size() {
		return map.size();
	}

	public void remove(K key) {
		map.remove(key);
	}

	public String toString() {
		return map.toString();
	}

	private static class EntryWrapper<K, V> implements MutableEntry<K, V>, EqualityTester<EntryWrapper<K,V>> {
		private java.util.Map.Entry<K, V> e;
		private EntryWrapper(java.util.Map.Entry<K, V> e) {
			this.e = e;
		}
		public K getKey() {
			return e.getKey();
		}
		public V getValue() {
			return e.getValue();
		}
		public void setValue(V v) {
			e.setValue(v);
		}
		public boolean equals(Object obj) {
			return StrictEqualityTester.areEqual(this, obj, this);
		}
		public boolean areEqual(EntryWrapper<K, V> o1, EntryWrapper<K, V> o2) {
			return o1.getKey().equals(o2.getKey()) && o1.getValue().equals(o2.getValue());
		}
		public int hashCode() {
			return PairHash.hash(getKey().hashCode(), getValue().hashCode());
		}
	}

}

class ConvertedDataIterator {
	public static <T1, T2> Iterator<T2> create(final Iterator<T1> original, final DataConverter<T1, T2> converter) {
		return new ReadOnlyIterator<T2>() {
			public boolean hasNext() {
				return original.hasNext();
			}
			public T2 next() {
				return converter.convert(original.next());
			}
		};
	}
}

interface DataConverter<T1, T2> {
	T2 convert(T1 v);
}

interface EqualityTester<T> {
	boolean areEqual(T o1, T o2);
}

class StrictEqualityTester {
	@SuppressWarnings("unchecked")
	public static <T> boolean areEqual(T me, Object you, EqualityTester<T> tester) {
		if(me == you)
			return true;
		if(you == null)
			return false;
		if(you.getClass() != me.getClass())
			return false;
		return tester.areEqual(me, (T)you);
	}
}

class PairHash {
	public static int hash(int h1, int h2) {
		return ThomasWangHash.hash64bit((((long) h1) << 32) | h2);
	}
}

class ThomasWangHash {

	// from http://www.concentric.net/~ttwang/tech/inthash.htm

	public static int hash32bit(int key) {
		key = ~key + (key << 15); // key = (key << 15) - key - 1;
		key = key ^ (key >>> 12);
		key = key + (key << 2);
		key = key ^ (key >>> 4);
		key = key * 2057; // key = (key + (key << 3)) + (key << 11);
		key = key ^ (key >>> 16);
		return key;
	}

	public static int hash64bit(long key) {
		key = (~key) + (key << 18); // key = (key << 18) - key - 1;
		key = key ^ (key >>> 31);
		key = key * 21; // key = (key + (key << 2)) + (key << 4);
		key = key ^ (key >>> 11);
		key = key + (key << 6);
		key = key ^ (key >>> 22);
		return (int) key;
	}
}


import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.Random;
import java.util.StringTokenizer;

public class CF173D2E implements CodeforcesSolver {

	public void solve(InputStream is) {
		FastScanner in = new FastScanner(is);
		int n = in.nextInt();
		long[] a = new long[n];
		for(int i : Range.zeroTo(n))
			a[i] = in.nextLong();

//		n = 100000;
//		a = new long[n];
//		for(int i : Range.zeroTo(n))
//			a[i] = new Random().nextLong() % 1000000000000L;

		long left = xorAll(a);
		long right = 0;
		long max = 0;
		Trie<Boolean> trie = new Trie<Boolean>(null, new MutableMapFactoryForOneKeyType<Boolean>() {
			public <V> MutableMap<Boolean, V> create() {
				return new MutableMap<Boolean, V>() {
					V falseValue = null;
					V trueValue = null;
					public void clear() {
						falseValue = null;
						trueValue= null;
					}
					public boolean containsKey(Boolean key) {
						if(key)
							return trueValue != null;
						else
							return falseValue != null;
					}
					public V get(Boolean key) {
						V r = get(key, null);
						if(r == null)
							throw new RuntimeException();
						return r;
					}
					public V get(Boolean key, V def) {
						V r;
						if(key)
							r = trueValue;
						else
							r = falseValue;
						if(r != null)
							return r;
						else
							return def;
					}
					public boolean isEmpty() {
						return trueValue == null && falseValue != null;
					}
					public Iterator<MutableEntry<Boolean, V>> iterator() {
						return ConvertedDataIterable.create(keys(), new DataConverter<Boolean, MutableEntry<Boolean, V>>() {
							public MutableEntry<Boolean, V> convert(final Boolean key) {
								return new MutableEntry<Boolean, V>() {
									public Boolean getKey() {
										return key;
									}
									public V getValue() {
										return get(key);
									}
									public void setValue(V value) {
										put(key, value);
									}
								};
							}
						}).iterator();
					}
					public Iterable<Boolean> keys() {
						return FilteringIterable.create(ArrayIterable.create(false, true), new DataFilter<Boolean>() {
							public boolean isAccepted(Boolean v) {
								if(v)
									return trueValue != null;
								else
									return falseValue != null;
							}
						});
					}
					public int size() {
						return (trueValue!=null?1:0) + (falseValue!=null?1:0);
					}
					public void put(Boolean key, V value) {
						if(key)
							trueValue = value;
						else
							falseValue = value;
					}
					public void remove(Boolean key) {
						put(key, null);
					}
					public Iterable<V> values() {
						return ConvertedDataIterable.create(keys(), new DataConverter<Boolean, V>() {
							public V convert(final Boolean key) {
								return get(key);
							}
						});
					}
				};
			}
		});
		trie.add(toarray(0));
		for(int i=n; i>= 0; i--) {
			TrieNode<Boolean> cur = trie.getRoot();
			long best = 0;
			for(int j=63;j>=0;j--) {
				boolean leftbit = (left & (1L<<j)) > 0; // TODO LongBitUtil?? ??????.
				boolean prefer = !leftbit;
				if(cur.hasChild(prefer)) {
					cur = cur.getChild(prefer);
					best |= (1<<j);
				} else {
					cur = cur.getChild(!prefer);
				}
			}
//			System.out.println("L " + left);
//			System.out.println(trie);
			max = Math.max(max, best);

			if(i-1 >= 0) {
				left ^= a[i-1];
				right ^= a[i-1];
				Array<Boolean> array = toarray(right);
				trie.add(array);
			}
		}
		System.out.println(max);
	}

	private long xorAll(long[] a) {
		long r = 0;
		for(long v : a)
			r ^= v;
		return r;
	}

	private Array<Boolean> toarray(long right) {
		boolean[] r = new boolean[64];
		for(int j=63;j>=0;j--)
			r[63-j] = (right & (1L<<j)) > 0;
		return new MutableArrayUsingBooleanArray(r);
	}

	public static void main(String[] args) throws Exception {
		CodeforcesSolverLauncher.launch(new CodeforcesSolverFactory() {
			public CodeforcesSolver create() {
				return new CF173D2E();
			}
		}, "E1.txt", "E2.txt", "E3.txt", "E4.txt");
	}

}

interface CodeforcesSolver {
	void solve(InputStream is);
}

interface CodeforcesSolverFactory {
	CodeforcesSolver create();
}

class CodeforcesSolverLauncher {

	public static void launch(CodeforcesSolverFactory factory, String... inputFilePath) throws FileNotFoundException, IOException {
		if(System.getProperty("ONLINE_JUDGE", "false").equals("true")) {
			factory.create().solve(System.in);
		} else {
			for(String path : inputFilePath) {
				FileInputStream is = new FileInputStream(new File(path));
				factory.create().solve(is);
				is.close();
				System.out.println();
			}
		}
	}

}

class FastScanner {

	private StringTokenizer tokenizer;

	public FastScanner(InputStream is) {
		try {
			ByteArrayOutputStream bos = new ByteArrayOutputStream(10*1024*1024);
			byte[] buf = new byte[1024*1024];
			while(true) {
				int read = is.read(buf);
				if(read == -1)
					break;
				bos.write(buf, 0, read);
			}
			tokenizer = new StringTokenizer(new String(bos.toByteArray()));
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

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

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

	public String next() {
		return tokenizer.nextToken();
	}

}

class ConvertedDataIterable {

	public static <T1, T2> Iterable<T2> create(final Iterable<T1> outerIterable, final DataConverter<T1, T2> converter) {
		return new Iterable<T2>() {
			public Iterator<T2> iterator() {
				return ConvertedDataIterator.create(outerIterable.iterator(), converter);
			}
		};
	}
}

class ConvertedDataIterator {
	public static <T1, T2> Iterator<T2> create(final Iterator<T1> original, final DataConverter<T1, T2> converter) {
		return new ReadOnlyIterator<T2>() {
			public boolean hasNext() {
				return original.hasNext();
			}
			public T2 next() {
				return converter.convert(original.next());
			}
		};
	}
}

interface DataConverter<T1, T2> {
	T2 convert(T1 v);
}

abstract class ReadOnlyIterator<T> implements Iterator<T> {
	public final void remove() {
		throw new UnsupportedOperationException();
	}
}

interface DataFilter<T> {
	boolean isAccepted(T v);
}

class FilteringIterable {

	public static <T> Iterable<T> create(final Iterable<? extends T> original, final DataFilter<T> filter) {
		return new Iterable<T>() {
			public Iterator<T> iterator() {
				return new ReadOnlyIterator<T>() {

					Iterator<? extends T> cursor = original.iterator();
					boolean hasNext = false;
					T next;

					public boolean hasNext() {
						ensureNext();
						return hasNext;
					}

					public T next() {
						ensureNext();
						hasNext = false;
						return next;
					}

					private void ensureNext() {
						if(!hasNext) {
							while(cursor.hasNext()) {
								T value = cursor.next();
								if(filter.isAccepted(value)) {
									next = value;
									hasNext = true;
									break;
								}
							}
						}
					}
				};
			}
		};
	}
}

class Range {

	public static Iterable<Integer> zeroTo(int end) {
		return fromTo(0, end);
	}

	public static Iterable<Integer> fromTo(int begin, int end) {
		return IntSequenceIterable.create(begin, 1, end-begin);
	}

}

class IntSequenceIterable {
	public static Iterable<Integer> create(final int from, final int step, final int size) {
		return new Iterable<Integer>() {
			public Iterator<Integer> iterator() {
				return new ReadOnlyIterator<Integer>() {
					int nextIndex = 0;
					public boolean hasNext() {
						return nextIndex < size;
					}
					public Integer next() {
						return from + step * (nextIndex++);
					}
				};
			}
		};
	}
}

class ArrayIterable {

	public static <T> Iterable<T> create(final T... data) {
		return ConvertedDataIterable.create(Range.zeroTo(data.length), new DataConverter<Integer, T>() {
			public T convert(Integer v) {
				return data[v];
			}
		});
	}

}

interface Array<T> extends Collection<T> {
	T get(int index);
}

interface Collection<T> extends Iterable<T> {
	int size();
	boolean isEmpty();
}

class MutableArrayUsingBooleanArray implements MutableArray<Boolean> {

	// TODO static createor�� �ٲٱ�.

	private final boolean[] a;
	private final int n;

	public MutableArrayUsingBooleanArray(boolean[] a) {
		this.a = a;
		n = a.length;
	}

	public MutableArrayUsingBooleanArray(boolean[] a, int n) {
		this.a = a;
		this.n = n;
	}

	public Boolean get(int i) {
		return a[i];
	}

	public void set(int i, Boolean v) {
		a[i] = v;
	}

	public int size() {
		return n;
	}

	public final boolean isEmpty() {
		return size() == 0;
	}

	public final Iterator<Boolean> iterator() {
		return ArrayIterator.create(this);
	}

	public final String toString() {
		return IterableToString.toString(this);
	}

}

class IterableToString {
	public static <T> String toString(Iterable<T> iterable) {
		StringBuilder sb = new StringBuilder();
		sb.append('(');
		boolean first = true;
		for(T v : iterable) {
			if(first)
				first = false;
			else
				sb.append(',');
			sb.append(v);
		}
		sb.append(')');
		return sb.toString();
	}
}

class ArrayIterator {
	public static <T> Iterator<T> create(final Array<T> a) {
		return new ReadOnlyIterator<T>() {
			int p = 0;
			public boolean hasNext() {
				return p < a.size();
			}
			public T next() {
				return a.get(p++);
			}
		};
	}
}

interface MutableArray<T> extends Array<T> {
	void set(int index, T value);
}

interface MutableEntry<K, V> {
	// TODO �̰͵� �׳� Entry�� �־�� �ұ�?
	K getKey();
	V getValue();
	void setValue(V v);
}

interface MutableMap<K, V> extends Collection<MutableEntry<K, V>> {
	// TODO ���������̽� �̱�.
	void clear();
	void put(K key, V value);
	void remove(K key);
	boolean containsKey(K key);
	V get(K key);
	V get(K key, V def);
	Iterable<V> values();
	Iterable<K> keys();
}

interface MutableMapFactoryForOneKeyType<K> {
	<V> MutableMap<K, V> create();
}

class Trie<T> {

	private TrieNodeFactory<T> nodeFactory;
	private MutableMapFactoryForOneKeyType<T> mapFactory;

	private final TrieNode<T> root;

	public Trie(TrieNodeFactory<T> nodeFactory, MutableMapFactoryForOneKeyType<T> mapFactory) {
		this.nodeFactory = nodeFactory;
		this.mapFactory = mapFactory;
		root = new GenericTrieNode<T>(mapFactory);
	}

	public void add(Iterable<T> sequence) {
		TrieNode<T> cur = root;
		for(T v : sequence) {
			TrieNode<T> subTrie = cur.getChild(v, null);
			if(subTrie == null) {
				subTrie = new GenericTrieNode<T>(mapFactory);
				cur.putChild(v, subTrie);
			}
			cur = subTrie;
		}
	}

	public TrieNode<T> getRoot() {
		return root;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		toString(root, 0, sb);
		return sb.toString();
	}

	private void toString(TrieNode<T> node, int level, StringBuilder sb) {
		for(T c : node.getEdges()) {
			for(@SuppressWarnings("unused") int i : Range.zeroTo(level))
				sb.append(" ");
			sb.append(c + "\n");
			toString(node.getChild(c), level+1, sb);
		}
	}

}

class GenericTrieNode<T> implements TrieNode<T> {

	private final MutableMap<T, TrieNode<T>> children;

	public GenericTrieNode(MutableMapFactoryForOneKeyType<T> mapFactory) {
		children = mapFactory.create();
	}

	public boolean hasChild(T ch) {
		return children.containsKey(ch);
	}

	public TrieNode<T> getChild(T ch, TrieNode<T> def) {
		TrieNode<T> r = children.get(ch, null);
		if(r != null)
			return r;
		else
			return def;
	}

	public void putChild(T ch, TrieNode<T> node) {
		children.put(ch, node);
	}

	public int getChildCount() {
		return children.size();
	}

	public TrieNode<T> getChild(T ch) {
		return children.get(ch);
	}

	public Iterable<T> getEdges() {
		return children.keys();
	}

}

interface TrieNode<T> {
	int getChildCount();
	boolean hasChild(T ch);
	TrieNode<T> getChild(T ch, TrieNode<T> def);
	TrieNode<T> getChild(T ch);
	Iterable<T> getEdges();
	void putChild(T ch, TrieNode<T> node);
}

interface TrieNodeFactory<T> {
	TrieNode<T> create();
}


import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.StringTokenizer;

public class CF173D2E implements CodeforcesSolver {

	//

	public void solve(InputStream is) {
		FastScanner in = new FastScanner(is);
		int n = in.nextInt();
		long[] a = new long[n];
		for(int i : ZeroTo.get(n))
			a[i] = in.nextLong();

		long leftsum = xorAll(a);
		long rightsum = 0;
		long max = 0;

		Trie<Boolean> trie = new Trie<Boolean>(TrieNodeFactoryForBooleanKey.getInstance());
		trie.add(getBitSequence(0));

		for(int i=n; i>= 0; i--) {
			TrieNode<Boolean> cur = trie.getRoot();
			long best = 0;
			for(int j=63;j>=0;j--) {
				boolean prefer = !LongBitUtil.get(leftsum, j);
				if(cur.hasChild(prefer)) {
					cur = cur.getChild(prefer);
					best = LongBitUtil.set(best, j);
				} else {
					cur = cur.getChild(!prefer);
				}
			}
			max = Math.max(max, best);

			if(i >= 1) {
				leftsum ^= a[i-1];
				rightsum ^= a[i-1];
				trie.add(getBitSequence(rightsum));
			}
		}
		System.out.println(max);
	}

	private long xorAll(long[] a) {
		long r = 0;
		for(long v : a)
			r ^= v;
		return r;
	}

	private Iterable<Boolean> getBitSequence(final long v) {
		return ConvertedDataIterable.create(IntSequenceIterable.create(63, -1, 64), new DataConverter<Integer, Boolean>() {
			public Boolean convert(Integer i) {
				return LongBitUtil.get(v, i);
			}
		});
	}

	public static void main(String[] args) throws Exception {
		CodeforcesSolverLauncher.launch(new CodeforcesSolverFactory() {
			public CodeforcesSolver create() {
				return new CF173D2E();
			}
		}, "E1.txt", "E2.txt", "E3.txt", "E4.txt");
	}

}

interface CodeforcesSolver {
	void solve(InputStream is);
}

interface CodeforcesSolverFactory {
	CodeforcesSolver create();
}

class CodeforcesSolverLauncher {

	public static void launch(CodeforcesSolverFactory factory, String... inputFilePath) throws FileNotFoundException, IOException {
		if(System.getProperty("ONLINE_JUDGE", "false").equals("true")) {
			factory.create().solve(System.in);
		} else {
			for(String path : inputFilePath) {
				FileInputStream is = new FileInputStream(new File(path));
				factory.create().solve(is);
				is.close();
				System.out.println();
			}
		}
	}

}

class FastScanner {

	private StringTokenizer tokenizer;

	public FastScanner(InputStream is) {
		try {
			ByteArrayOutputStream bos = new ByteArrayOutputStream(1024*1024);
			byte[] buf = new byte[1024*1024];
			while(true) {
				int read = is.read(buf);
				if(read == -1)
					break;
				bos.write(buf, 0, read);
			}
			tokenizer = new StringTokenizer(new String(bos.toByteArray()));
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

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

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

	public String next() {
		return tokenizer.nextToken();
	}

}

class ConvertedDataIterable {

	public static <T1, T2> Iterable<T2> create(final Iterable<T1> outerIterable, final DataConverter<T1, T2> converter) {
		return new Iterable<T2>() {
			public Iterator<T2> iterator() {
				return ConvertedDataIterator.create(outerIterable.iterator(), converter);
			}
		};
	}

	private ConvertedDataIterable() {
	}
}

class ConvertedDataIterator {

	public static <T1, T2> Iterator<T2> create(final Iterator<T1> original, final DataConverter<T1, T2> converter) {
		return new ReadOnlyIterator<T2>() {
			public boolean hasNext() {
				return original.hasNext();
			}
			public T2 next() {
				return converter.convert(original.next());
			}
		};
	}

	private ConvertedDataIterator() {
	}
}

interface DataConverter<T1, T2> {
	T2 convert(T1 v);
}

abstract class ReadOnlyIterator<T> implements Iterator<T> {
	public final void remove() {
		throw new UnsupportedOperationException();
	}
}

class IntSequenceIterable {
	public static Iterable<Integer> create(final int from, final int step, final int size) {
		return new Iterable<Integer>() {
			public Iterator<Integer> iterator() {
				return new ReadOnlyIterator<Integer>() {
					int nextIndex = 0;
					public boolean hasNext() {
						return nextIndex < size;
					}
					public Integer next() {
						return from + step * (nextIndex++);
					}
				};
			}
		};
	}

	private IntSequenceIterable() {
	}
}

class ZeroTo {

	public static Iterable<Integer> get(int end) {
		return FromTo.get(0, end);
	}

}

class FromTo {

	public static Iterable<Integer> get(int begin, int end) {
		return IntSequenceIterable.create(begin, 1, end-begin);
	}

}

class Trie<T> {

	private final TrieNodeFactory<T> factory;
	private final TrieNode<T> root;

	public Trie(TrieNodeFactory<T> nodeFactory) {
		this.factory = nodeFactory;
		root = factory.create();
	}

	public void add(Iterable<T> sequence) {
		TrieNode<T> cur = root;
		for(T v : sequence) {
			TrieNode<T> subTrie = cur.getChild(v, null);
			if(subTrie == null) {
				subTrie = factory.create();
				cur.putChild(v, subTrie);
			}
			cur = subTrie;
		}
	}

	public TrieNode<T> getRoot() {
		return root;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		toString(root, 0, sb);
		return sb.toString();
	}

	private void toString(TrieNode<T> node, int level, StringBuilder sb) {
		for(T c : node.getEdges()) {
			for (@SuppressWarnings("unused")
			int i : ZeroTo.get(level))
				sb.append(" ");
			sb.append(c + "\n");
			toString(node.getChild(c), level+1, sb);
		}
	}

}

interface TrieNode<T> {
	int getChildCount();
	boolean hasChild(T ch);
	TrieNode<T> getChild(T ch, TrieNode<T> def);
	TrieNode<T> getChild(T ch);
	Iterable<T> getEdges();
	void putChild(T ch, TrieNode<T> node);
}

interface TrieNodeFactory<T> {
	TrieNode<T> create();
}

final class TrieNodeFactoryForBooleanKey {

	// specialized in speed for boolean keyed nodes.

	public static TrieNodeFactory<Boolean> getInstance() {
		return new TrieNodeFactory<Boolean>() {
			public TrieNode<Boolean> create() {
				return new BooleanTrieNode();
			}
		};
	}

	private static class BooleanTrieNode implements TrieNode<Boolean> {

		private TrieNode<Boolean> zero, one;

		public void putChild(Boolean ch, TrieNode<Boolean> node) {
			if(ch)
				one = node;
			else
				zero = node;
		}

		public boolean hasChild(Boolean ch) {
			return (ch?one:zero) != null;
		}

		public Iterable<Boolean> getEdges() {
			return FilteredIterable.create(ArrayIterable.create(false, true), new DataFilter<Boolean>() { // slow. improve when need.
				public boolean isAccepted(Boolean v) {
					return hasChild(v);
				}
			});
		}

		public int getChildCount() {
			return (one==null?0:1) + (zero==null?0:1);
		}

		public TrieNode<Boolean> getChild(Boolean ch) {
			TrieNode<Boolean> cand = getChild(ch, null);
			if(cand == null)
				throw new RuntimeException();
			return cand;
		}

		public TrieNode<Boolean> getChild(Boolean ch, TrieNode<Boolean> def) {
			TrieNode<Boolean> cand = ch ? one : zero;
			if(cand != null)
				return cand;
			else
				return def;
		}
	}

	private TrieNodeFactoryForBooleanKey() {}

}

class ArrayIterable {

	public static <T> Iterable<T> create(final T... data) {
		return ConvertedDataIterable.create(ZeroTo.get(data.length), new DataConverter<Integer, T>() {
			public T convert(Integer v) {
				return data[v];
			}
		});
	}

	private ArrayIterable() {
	}

}

interface DataFilter<T> {
	boolean isAccepted(T v);
}

class FilteredIterable {

	public static <T> Iterable<T> create(final Iterable<? extends T> original, final DataFilter<T> filter) {
		return new Iterable<T>() {
			public Iterator<T> iterator() {
				return new FilteredIterator<T>(filter, original);
			}
		};
	}

	private static final class FilteredIterator<T> extends ReadOnlyIterator<T> {
		private final DataFilter<T> filter;
		private final Iterator<? extends T> cursor;
		private T next = null;

		private FilteredIterator(DataFilter<T> filter, Iterable<? extends T> original) {
			this.filter = filter;
			cursor = original.iterator();
		}

		public boolean hasNext() {
			tryToStepNext();
			return next != null;
		}

		public T next() {
			tryToStepNext();
			T r = next;
			next = null;
			return r;
		}

		private void tryToStepNext() {
			if (next == null) {
				while(cursor.hasNext()) {
					T value = cursor.next();
					if(filter.isAccepted(value)) {
						next = value;
						break;
					}
				}
			}
		}
	}

	private FilteredIterable() {
	}

}

class LongBitUtil {

	static long set(long v, int pos) {
		return v | (1L<<pos);
	}

	public static boolean get(long v, int pos) {
		return (v & (1L<<pos)) > 0;
	}

}


import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.Random;
import java.util.StringTokenizer;

public class CF173D2E implements CodeforcesSolver {

	public void solve(InputStream is) {
		FastScanner in = new FastScanner(is);
		int n = in.nextInt();
		long[] a = new long[n];
		for(int i : Range.zeroTo(n))
			a[i] = in.nextLong();

//		n = 100000;
//		a = new long[n];
//		for(int i : Range.zeroTo(n))
//			a[i] = new Random().nextLong() % 1000000000000L;

		long left = xorAll(a);
		long right = 0;
		long max = 0;
		Trie<Boolean> trie = new Trie<Boolean>(null, new MutableMapFactoryForOneKeyType<Boolean>() {
			public <V> MutableMap<Boolean, V> create() {
				return new MutableMap<Boolean, V>() {
					V falseValue = null;
					V trueValue = null;
					public void clear() {
						falseValue = null;
						trueValue= null;
					}
					public boolean containsKey(Boolean key) {
						if(key)
							return trueValue != null;
						else
							return falseValue != null;
					}
					public V get(Boolean key) {
						V r = get(key, null);
						if(r == null)
							throw new RuntimeException();
						return r;
					}
					public V get(Boolean key, V def) {
						V r;
						if(key)
							r = trueValue;
						else
							r = falseValue;
						if(r != null)
							return r;
						else
							return def;
					}
					public boolean isEmpty() {
						return trueValue == null && falseValue != null;
					}
					public Iterator<MutableEntry<Boolean, V>> iterator() {
						return ConvertedDataIterable.create(keys(), new DataConverter<Boolean, MutableEntry<Boolean, V>>() {
							public MutableEntry<Boolean, V> convert(final Boolean key) {
								return new MutableEntry<Boolean, V>() {
									public Boolean getKey() {
										return key;
									}
									public V getValue() {
										return get(key);
									}
									public void setValue(V value) {
										put(key, value);
									}
								};
							}
						}).iterator();
					}
					public Iterable<Boolean> keys() {
						return FilteringIterable.create(ArrayIterable.create(false, true), new DataFilter<Boolean>() {
							public boolean isAccepted(Boolean v) {
								if(v)
									return trueValue != null;
								else
									return falseValue != null;
							}
						});
					}
					public int size() {
						return (trueValue!=null?1:0) + (falseValue!=null?1:0);
					}
					public void put(Boolean key, V value) {
						if(key)
							trueValue = value;
						else
							falseValue = value;
					}
					public void remove(Boolean key) {
						put(key, null);
					}
					public Iterable<V> values() {
						return ConvertedDataIterable.create(keys(), new DataConverter<Boolean, V>() {
							public V convert(final Boolean key) {
								return get(key);
							}
						});
					}
				};
			}
		});
		trie.add(toarray(0));
		for(int i=n; i>= 0; i--) {
			TrieNode<Boolean> cur = trie.getRoot();
			long best = 0;
			for(int j=63;j>=0;j--) {
				boolean leftbit = (left & (1L<<j)) > 0; // TODO LongBitUtil?? ??????.
				boolean prefer = !leftbit;
				if(cur.hasChild(prefer)) {
					cur = cur.getChild(prefer);
					best |= (1L<<j);
				} else {
					cur = cur.getChild(!prefer);
				}
			}
//			System.out.println("L " + left);
//			System.out.println(trie);
			max = Math.max(max, best);

			if(i-1 >= 0) {
				left ^= a[i-1];
				right ^= a[i-1];
				Array<Boolean> array = toarray(right);
				trie.add(array);
			}
		}
		System.out.println(max);
	}

	private long xorAll(long[] a) {
		long r = 0;
		for(long v : a)
			r ^= v;
		return r;
	}

	private Array<Boolean> toarray(long right) {
		boolean[] r = new boolean[64];
		for(int j=63;j>=0;j--)
			r[63-j] = (right & (1L<<j)) > 0;
		return new MutableArrayUsingBooleanArray(r);
	}

	public static void main(String[] args) throws Exception {
		CodeforcesSolverLauncher.launch(new CodeforcesSolverFactory() {
			public CodeforcesSolver create() {
				return new CF173D2E();
			}
		}, "E1.txt", "E2.txt", "E3.txt", "E4.txt");
	}

}

interface CodeforcesSolver {
	void solve(InputStream is);
}

interface CodeforcesSolverFactory {
	CodeforcesSolver create();
}

class CodeforcesSolverLauncher {

	public static void launch(CodeforcesSolverFactory factory, String... inputFilePath) throws FileNotFoundException, IOException {
		if(System.getProperty("ONLINE_JUDGE", "false").equals("true")) {
			factory.create().solve(System.in);
		} else {
			for(String path : inputFilePath) {
				FileInputStream is = new FileInputStream(new File(path));
				factory.create().solve(is);
				is.close();
				System.out.println();
			}
		}
	}

}

class FastScanner {

	private StringTokenizer tokenizer;

	public FastScanner(InputStream is) {
		try {
			ByteArrayOutputStream bos = new ByteArrayOutputStream(10*1024*1024);
			byte[] buf = new byte[1024*1024];
			while(true) {
				int read = is.read(buf);
				if(read == -1)
					break;
				bos.write(buf, 0, read);
			}
			tokenizer = new StringTokenizer(new String(bos.toByteArray()));
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

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

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

	public String next() {
		return tokenizer.nextToken();
	}

}

class ConvertedDataIterable {

	public static <T1, T2> Iterable<T2> create(final Iterable<T1> outerIterable, final DataConverter<T1, T2> converter) {
		return new Iterable<T2>() {
			public Iterator<T2> iterator() {
				return ConvertedDataIterator.create(outerIterable.iterator(), converter);
			}
		};
	}
}

class ConvertedDataIterator {
	public static <T1, T2> Iterator<T2> create(final Iterator<T1> original, final DataConverter<T1, T2> converter) {
		return new ReadOnlyIterator<T2>() {
			public boolean hasNext() {
				return original.hasNext();
			}
			public T2 next() {
				return converter.convert(original.next());
			}
		};
	}
}

interface DataConverter<T1, T2> {
	T2 convert(T1 v);
}

abstract class ReadOnlyIterator<T> implements Iterator<T> {
	public final void remove() {
		throw new UnsupportedOperationException();
	}
}

interface DataFilter<T> {
	boolean isAccepted(T v);
}

class FilteringIterable {

	public static <T> Iterable<T> create(final Iterable<? extends T> original, final DataFilter<T> filter) {
		return new Iterable<T>() {
			public Iterator<T> iterator() {
				return new ReadOnlyIterator<T>() {

					Iterator<? extends T> cursor = original.iterator();
					boolean hasNext = false;
					T next;

					public boolean hasNext() {
						ensureNext();
						return hasNext;
					}

					public T next() {
						ensureNext();
						hasNext = false;
						return next;
					}

					private void ensureNext() {
						if(!hasNext) {
							while(cursor.hasNext()) {
								T value = cursor.next();
								if(filter.isAccepted(value)) {
									next = value;
									hasNext = true;
									break;
								}
							}
						}
					}
				};
			}
		};
	}
}

class Range {

	public static Iterable<Integer> zeroTo(int end) {
		return fromTo(0, end);
	}

	public static Iterable<Integer> fromTo(int begin, int end) {
		return IntSequenceIterable.create(begin, 1, end-begin);
	}

}

class IntSequenceIterable {
	public static Iterable<Integer> create(final int from, final int step, final int size) {
		return new Iterable<Integer>() {
			public Iterator<Integer> iterator() {
				return new ReadOnlyIterator<Integer>() {
					int nextIndex = 0;
					public boolean hasNext() {
						return nextIndex < size;
					}
					public Integer next() {
						return from + step * (nextIndex++);
					}
				};
			}
		};
	}
}

class ArrayIterable {

	public static <T> Iterable<T> create(final T... data) {
		return ConvertedDataIterable.create(Range.zeroTo(data.length), new DataConverter<Integer, T>() {
			public T convert(Integer v) {
				return data[v];
			}
		});
	}

}

interface Array<T> extends Collection<T> {
	T get(int index);
}

interface Collection<T> extends Iterable<T> {
	int size();
	boolean isEmpty();
}

class MutableArrayUsingBooleanArray implements MutableArray<Boolean> {

	// TODO static createor�� �ٲٱ�.

	private final boolean[] a;
	private final int n;

	public MutableArrayUsingBooleanArray(boolean[] a) {
		this.a = a;
		n = a.length;
	}

	public MutableArrayUsingBooleanArray(boolean[] a, int n) {
		this.a = a;
		this.n = n;
	}

	public Boolean get(int i) {
		return a[i];
	}

	public void set(int i, Boolean v) {
		a[i] = v;
	}

	public int size() {
		return n;
	}

	public final boolean isEmpty() {
		return size() == 0;
	}

	public final Iterator<Boolean> iterator() {
		return ArrayIterator.create(this);
	}

	public final String toString() {
		return IterableToString.toString(this);
	}

}

class IterableToString {
	public static <T> String toString(Iterable<T> iterable) {
		StringBuilder sb = new StringBuilder();
		sb.append('(');
		boolean first = true;
		for(T v : iterable) {
			if(first)
				first = false;
			else
				sb.append(',');
			sb.append(v);
		}
		sb.append(')');
		return sb.toString();
	}
}

class ArrayIterator {
	public static <T> Iterator<T> create(final Array<T> a) {
		return new ReadOnlyIterator<T>() {
			int p = 0;
			public boolean hasNext() {
				return p < a.size();
			}
			public T next() {
				return a.get(p++);
			}
		};
	}
}

interface MutableArray<T> extends Array<T> {
	void set(int index, T value);
}

interface MutableEntry<K, V> {
	// TODO �̰͵� �׳� Entry�� �־�� �ұ�?
	K getKey();
	V getValue();
	void setValue(V v);
}

interface MutableMap<K, V> extends Collection<MutableEntry<K, V>> {
	// TODO ���������̽� �̱�.
	void clear();
	void put(K key, V value);
	void remove(K key);
	boolean containsKey(K key);
	V get(K key);
	V get(K key, V def);
	Iterable<V> values();
	Iterable<K> keys();
}

interface MutableMapFactoryForOneKeyType<K> {
	<V> MutableMap<K, V> create();
}

class Trie<T> {

	private TrieNodeFactory<T> nodeFactory;
	private MutableMapFactoryForOneKeyType<T> mapFactory;

	private final TrieNode<T> root;

	public Trie(TrieNodeFactory<T> nodeFactory, MutableMapFactoryForOneKeyType<T> mapFactory) {
		this.nodeFactory = nodeFactory;
		this.mapFactory = mapFactory;
		root = new GenericTrieNode<T>(mapFactory);
	}

	public void add(Iterable<T> sequence) {
		TrieNode<T> cur = root;
		for(T v : sequence) {
			TrieNode<T> subTrie = cur.getChild(v, null);
			if(subTrie == null) {
				subTrie = new GenericTrieNode<T>(mapFactory);
				cur.putChild(v, subTrie);
			}
			cur = subTrie;
		}
	}

	public TrieNode<T> getRoot() {
		return root;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		toString(root, 0, sb);
		return sb.toString();
	}

	private void toString(TrieNode<T> node, int level, StringBuilder sb) {
		for(T c : node.getEdges()) {
			for(@SuppressWarnings("unused") int i : Range.zeroTo(level))
				sb.append(" ");
			sb.append(c + "\n");
			toString(node.getChild(c), level+1, sb);
		}
	}

}

class GenericTrieNode<T> implements TrieNode<T> {

	private final MutableMap<T, TrieNode<T>> children;

	public GenericTrieNode(MutableMapFactoryForOneKeyType<T> mapFactory) {
		children = mapFactory.create();
	}

	public boolean hasChild(T ch) {
		return children.containsKey(ch);
	}

	public TrieNode<T> getChild(T ch, TrieNode<T> def) {
		TrieNode<T> r = children.get(ch, null);
		if(r != null)
			return r;
		else
			return def;
	}

	public void putChild(T ch, TrieNode<T> node) {
		children.put(ch, node);
	}

	public int getChildCount() {
		return children.size();
	}

	public TrieNode<T> getChild(T ch) {
		return children.get(ch);
	}

	public Iterable<T> getEdges() {
		return children.keys();
	}

}

interface TrieNode<T> {
	int getChildCount();
	boolean hasChild(T ch);
	TrieNode<T> getChild(T ch, TrieNode<T> def);
	TrieNode<T> getChild(T ch);
	Iterable<T> getEdges();
	void putChild(T ch, TrieNode<T> node);
}

interface TrieNodeFactory<T> {
	TrieNode<T> create();
}