#include #include #include using namespace std; int N,K; int A[50505]; bool Lf[50505],Rf[50505]; bool Le[1<<20],Re[1<<20]; int cnt[1<<20]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N>>K; for(int i=0;i>A[i]; {//L int now=0; Le[now]=true; for(int i=0;iL,R; R.reserve(N+1); L.reserve(N+1); {//R int now=0; Re[now]=true; R.push_back(now); for(int i=N;i--;) { now^=A[i]; Rf[i]=Rf[i+1]||Re[now]; Re[now]=true; R.push_back(now); } } L.push_back(0); for(int r:R)cnt[r]++; int ALL=R.back(); for(int i=0;i