use std::io;
use num_bigint::BigUint;
use num_traits::{Zero, One};
const MOD: u64 = 1_000_000_007;
fn main() {
let mut input = String::new();
io::stdin().read_line(&mut input).unwrap();
let n: usize = input.trim().parse().unwrap();
input.clear();
io::stdin().read_line(&mut input).unwrap();
let a: Vec<u64> = input.trim().split_whitespace()
.map(|x| x.parse().unwrap())
.collect();
let result = calculate_partition_sum(n, &a);
println!("{}", result);
}
fn calculate_partition_sum(n: usize, a: &[u64]) -> BigUint {
let mut xor_sum = vec![0u64; n + 1];
let mut dp = vec![BigUint::zero(); n + 1];
dp[0] = BigUint::one(); // Base case: one way to partition an empty sequence
for i in 1..=n {
xor_sum[i] = 0;
for j in (1..=i).rev() {
xor_sum[j] ^= a[i - 1];
let current = dp[j - 1].clone() * BigUint::from(xor_sum[j]);
dp[i] = (dp[i].clone() + current) % MOD;
}
}
dp[n].clone()
}
impl std::ops::Rem<u64> for BigUint {
type Output = BigUint;
fn rem(self, modulus: u64) -> BigUint {
(&self % modulus).into()
}
}
impl<'a> std::ops::Rem<u64> for &'a BigUint {
type Output = BigUint;
fn rem(self, modulus: u64) -> BigUint {
BigUint::from((self % BigUint::from(modulus)).to_u64_digits()[0])
}
}