using System; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; namespace Solver { class Program { const int M = 1000000007; static void Main() { var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; Scan sc = new Scan(); var set = new HashSet(); int n = sc.Int(); long[] a = sc.LongArray(); set.Add(0); long p = 0; long ans = 2; foreach (long i in a) { if (set.Add(i) && set.Add(p = p ^ i)) ans *= 2; } sw.WriteLine(ans); sw.Flush(); } } class Scan { public int Int() { return int.Parse(Console.ReadLine().Trim()); } public long Long() { return long.Parse(Console.ReadLine().Trim()); } public string Str() { return Console.ReadLine().Trim(); } public int[] IntArray() { return Console.ReadLine().Trim().Split().Select(int.Parse).ToArray(); } public void IntTwi(out int a, out int b) { int[] arr = IntArray(); a = arr[0]; b = arr[1]; } public void LongTwi(out long a, out long b) { long[] arr = LongArray(); a = arr[0]; b = arr[1]; } public void StrTwi(out string a, out string b) { string[] arr = StrArray(); a = arr[0]; b = arr[1]; } public long[] LongArray() { return Console.ReadLine().Trim().Split().Select(long.Parse).ToArray(); } public string[] StrArray() { return Console.ReadLine().Trim().Split(); } } }