package yukicoder; import java.util.Scanner; import java.util.List; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.Collections; public class No1498 { public static void main(String[] args) { final int M = 1000000007; Scanner scan = new Scanner(System.in); int N = scan.nextInt(); List B = new ArrayList(); HashMap> D = new HashMap>(); int P = 0; for (int i=0; i < N-1; i++) { P ^= scan.nextInt(); B.add(P); if (D.containsKey(P)) { D.get(P).add(i); } else { List l = new ArrayList(); l.add(i); D.put(P, l); } } scan.nextInt(); scan.close(); int[] dp = new int[N]; dp[0] = 1; for (int i=0; i < N-1; i++) { for (List v : D.values()) { int j = Collections.binarySearch(v, i); if (j < 0) { j = -j - 1; } if (j >= v.size()) { continue; } dp[v.get(j)+1] = (dp[v.get(j)+1] + dp[i]) % M; } } int cnt = 0; for (int i=0; i < N; i++) { cnt = (cnt + dp[i]) % M; } System.out.println(cnt); } }