#include using namespace std; #define ll long long #define IO ios::sync_with_stdio(false);cin.tie(0) const int mod = 1e9 + 7; int main() { IO; //freopen("in.txt", "r", stdin); int n; cin >> n; map mp; ll pre = 0, ans = 1; for(int i = 0; i < n; ++i) { int x; cin >> x; if(i) { ll val = mp[pre]; mp[pre] = ans; ans <<= 1; ans -= val; ans = (ans % mod + mod) % mod; } pre ^= x; } cout << ans << '\n'; return 0; }