#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; mp[0] = 1; ll pre = 0, ans = 1; for(int i = 0; i < n; ++i) { ll x; cin >> x; ll val = mp[pre]; mp[pre] = ans; ans <<= 1; ans -= val; ans = (ans % mod + mod) % mod; pre ^= x; } cout << ans << '\n'; return 0; }