intmain(){ ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cin >> n; for (int i = 1; i <= n; ++i) cin >> a[i]; if (n <= 60) { int ans = n; for (int i = 1; i <= n; ++i) s[i] = s[i - 1] ^ a[i]; for (int i = 1; i < n; ++i) for (int j = 1; j <= i; ++j) for (int k = i + 1; k <= n; ++k) if ((s[i] ^ s[j - 1]) > (s[k] ^ s[i])) ans = min(ans, k - j - 1); ans == n ? cout << "-1\n" : cout << ans << "\n"; } elsecout << "1\n"; return0; }