Language: C++

#ifdef __GNUC__ 
#include <bits/stdc++.h>
auto & in = std::cin;
#else
std::istringstream in;
#endif
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/dynamic_bitset.hpp>
#include <boost/preprocessor.hpp>

using namespace std;
#define ALL(v) std::begin(v),std::end(v)
#define RALL(v) v.rbegin(),v.rend()
using u6 = std::uint64_t;
using u3 = std::uint32_t;
constexpr u6 moduloNo = 1'000'000'000 + 7; //' 1e9 + 7
constexpr u3 maxA = 0x10'0000;//'

#define APPLY_PP(pp, ...) pp( __VA_ARGS__ )
#define DEFVALUE1(r,type,name) type name;
#define DEFINIT1(r,type,name) in >> calc.name;
#define DEFVALUEIMPL(r,fn,tpl) BOOST_PP_LIST_FOR_EACH(fn,BOOST_PP_TUPLE_ELEM(0, tpl), BOOST_PP_TUPLE_TO_LIST(BOOST_PP_TUPLE_POP_FRONT(tpl)))
#define DEFVALUES(expr) APPLY_PP(DEFVALUESIMPL,expr)
#define DEFVALUESIMPL(expr) \
	BOOST_PP_SEQ_FOR_EACH(DEFVALUEIMPL,DEFVALUE1,BOOST_PP_VARIADIC_SEQ_TO_SEQ(expr))\
	template <> struct Initer<0>{template <typename T>static void init(T & calc){BOOST_PP_SEQ_FOR_EACH(DEFVALUEIMPL,DEFINIT1,BOOST_PP_VARIADIC_SEQ_TO_SEQ(expr)) }};

template <typename T>
struct invecT {
	decltype(auto) begin()const {
		return std::istream_iterator<T>(in);
	}
	decltype(auto) end()const {
		return std::istream_iterator<T>();
	}
};
template <typename T>
invecT<T> invec;
struct State {
	array<u3, 3> buf;
	//State() :buf{ 1,0,1 } {}
	constexpr State() :buf{1,0,0}{}
	State(u3 zerocount) :buf{ 1,0,zerocount } { addX(zerocount); }
	void addX(u3 zero) {
		if (zero != buf[2]) {
			u6 zerodiff = zero - buf[2];
			buf[0] = (u3)(((u6)buf[0] + zerodiff * buf[1]) % moduloNo);
			buf[2] = zero;

		}

		buf[1] = buf[0] + buf[1];
		buf[1] = (buf[1] >= moduloNo) ? buf[1] - moduloNo : buf[1];
	}
};
/*
u6 pow2(u6 n) {
	if (n < 64)return (u6(1) << n) % moduloNo;
	else if (n == 64)return (u6(0) - moduloNo) % moduloNo;
	u6 tmp = pow2(n / 2);
	tmp = tmp * tmp;
	if (n & 1)tmp *= 2;
	return tmp % moduloNo;
}
 //*/
u6 pow2(u6 n) {
	if(n<64)return (u6(1) << n) % moduloNo;
	vector<bool> mod2;
	while (n >= 64) {
		mod2.push_back(n&1);
		n >>= 1;
	}
	u6 result = (u6(1) << n) % moduloNo;
	result = std::accumulate(mod2.rbegin(), mod2.rend(), result, [](u6 st, bool i) {return ((st*st)<<u6(i))%moduloNo; });
	return result;
}
//*/

struct Calc {
	template <int i> struct Initer {
		template <typename T>static void init(T & calc) {}
	};
	DEFVALUES((u6,N));
	State stmap[maxA];
	u6 calc() {
		u3 st = 0;
		u3 zerocount = 0;
		for (auto tmp:invec<u3>) {
			// in >> tmp;
			st ^= tmp;
			if (!st) {
				++zerocount;
			}
			else {
				stmap[st].addX(zerocount);
			}
		}
		if (st != 0) {
			return stmap[st].buf[0];
		}
		else {
			u6 result = pow2(zerocount - 1);
			for (auto & stv : stmap) {
				result = (result + stv.buf[1]) % moduloNo;
			}
			return result;
		}
	}
};
Calc calc;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);//
#ifndef __GNUC__ 
	//in.str("24\n1 2 5 3 3 6 1 1 8 8 0 3 3 4 6 6 4 0 7 2 5 4 6 2");
	in.str("32\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0");
#endif
	Calc::Initer<0>::init(calc);
	cout << calc.calc() << endl;
}


Compiler output:
a.cc:7:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    7 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.