import java.math.BigInteger;
import java.util.Scanner;
public class PartitionXorSum {
private static final BigInteger MOD = BigInteger.valueOf(1_000_000_007);
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
long[] a = new long[n];
for (int i = 0; i < n; i++) {
a[i] = scanner.nextLong();
}
BigInteger result = calculatePartitionSum(n, a);
System.out.println(result);
}
private static BigInteger calculatePartitionSum(int n, long[] a) {
long[] xorSum = new long[n + 1];
BigInteger[] dp = new BigInteger[n + 1];
dp[0] = BigInteger.ONE; // Base case: one way to partition an empty sequence
for (int i = 1; i <= n; i++) {
xorSum[i] = 0;
dp[i] = BigInteger.ZERO;
for (int j = i; j > 0; j--) {
xorSum[j] ^= a[i - 1];
dp[i] = dp[i].add(dp[j - 1].multiply(BigInteger.valueOf(xorSum[j])));
dp[i] = dp[i].mod(MOD);
}
}
return dp[n];
}
}