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

public class Solution {
	FastScanner in;
	PrintWriter out;

	int n;
	long[] a;
	long ans;

	public void solve() throws IOException {
		n = in.nextInt();
		a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = in.nextLong();
		}
		int m1 = (n - 1) / 2;
		int m2 = (n - 1) - m1;
		int countPr1 = 1 << m1, countPr2 = 1 << m2;
		HashMap<Long, Long>[] cnt = new HashMap[m1 + 1];
		for (int i = 0; i <= m1; i++)
			cnt[i] = new HashMap<>();
		boolean[] b = new boolean[n];
		long[] sum = new long[m1 + 1];
		for (int i = m1 - 1; i >= 0; i--) {
			sum[i] = a[i];
			sum[i] += sum[i + 1];
		}
		for (int pr = 0; pr < countPr1; pr++) {
			for (int i = 0; i < m1; i++) {
				b[i] = (((pr >> i) & 1) != 0);
			}
			int atEnd = 0;
			for (int i = m1 - 1; i >= 0; i--) {
				if (!b[i])
					break;
				atEnd++;
			}
			long res = 0;
			for (int i = 0; i < m1 - atEnd; i++) {
				long cur = a[i];
				while (i < m1 - atEnd && b[i]) {
					i++;
					cur += a[i];
				}
				res ^= cur;
			}
			if (!cnt[atEnd].containsKey(res)) {
				cnt[atEnd].put(res, 0L);
			}
			cnt[atEnd].put(res, cnt[atEnd].get(res) + 1);
		}

		for (int pr = 0; pr < countPr2; pr++) {
			for (int i = 0; i < m2; i++) {
				b[m1 + i] = (((pr >> i) & 1) != 0);
			}
			int atSt = 0;
			long sumMid = 0;
			for (int i = 0; i <= m2; i++) {
				sumMid += a[m1 + i];
				if (!b[m1 + i])
					break;
				atSt++;
			}
			long res = 0;
			for (int i = atSt + 1; i <= m2; i++) {
				long cur = a[i + m1];
				while (i < m2 && b[i + m1]) {
					i++;
					cur += a[i + m1];
				}
				res ^= cur;
			}
			for (int atEnd = 0; atEnd <= m1; atEnd++) {
				long resWithEnd = (sumMid + sum[m1 - atEnd]) ^ res;
				if (cnt[atEnd].containsKey(resWithEnd)) {
					ans += cnt[atEnd].get(resWithEnd);
				}
			}
		}
		out.println(ans);
	}

	public void run() {
		try {
			in = new FastScanner();
			out = new PrintWriter(System.out);

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

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

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

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

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

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

	public static void main(String[] arg) {
		new Solution().run();
	}
}