#include #include #include #include #include #define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(i,m,n) for(int i=(m);i<(n);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() const int INF = 0x3f3f3f3f; const long long LINF = 0x3f3f3f3f3f3f3f3fLL; const double EPS = 1e-8; const int MOD = 1000000007; // 998244353; const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1}; /*-------------------------------------------------*/ const int MAX = 61; struct BinaryMatrix { int m, n; BinaryMatrix(int m_, int n_ = MAX, bool def = false) : m(m_), n(n_), dat(m, bitset(0)) { if (def) { REP(i, m) REP(j, n) dat[i][j] = 1; } } BinaryMatrix pow(long long exponent) { BinaryMatrix tmp = *this, res(n, n); REP(i, n) res[i][i] = 1; while (exponent > 0) { if (exponent & 1) res *= tmp; tmp *= tmp; exponent >>= 1; } return res; } inline const bitset &operator[](const int idx) const { return dat[idx]; } inline bitset &operator[](const int idx) { return dat[idx]; } BinaryMatrix &operator=(const BinaryMatrix &rhs) { m = rhs.m; n = rhs.n; dat.clear(); dat.resize(m); REP(i, m) dat[i] = rhs[i]; return *this; } BinaryMatrix &operator+=(const BinaryMatrix &rhs) { REP(i, m) dat[i] ^= rhs[i]; return *this; } BinaryMatrix &operator*=(const BinaryMatrix &rhs) { int height = m, width = rhs.n; BinaryMatrix t_rhs(rhs.n, rhs.m), res(height, width); REP(i, rhs.n) REP(j, rhs.m) t_rhs[i][j] = rhs[j][i]; REP(i, height) REP(j, width) res[i][j] = ((dat[i] & t_rhs[j]).count() & 1); *this = res; return *this; } BinaryMatrix operator+(const BinaryMatrix &rhs) const { return BinaryMatrix(*this) += rhs; } BinaryMatrix operator*(const BinaryMatrix &rhs) const { return BinaryMatrix(*this) *= rhs; } private: vector > dat; }; int gauss_jordan(BinaryMatrix &mat, bool is_extended = false) { int rank = 0; REP(col, mat.n) { if (is_extended && col == mat.n - 1) break; int pivot = -1; FOR(row, rank, mat.m) { if (mat[row][col]) { pivot = row; break; } } if (pivot == -1) continue; swap(mat[rank], mat[pivot]); REP(row, mat.m) { if (row != rank && mat[row][col]) mat[row] ^= mat[rank]; } ++rank; } return rank; } int main() { cin.tie(0); ios::sync_with_stdio(false); // freopen("input.txt", "r", stdin); int n; cin >> n; BinaryMatrix mat(n); REP(i, n) { long long a; cin >> a; mat[i] = bitset(a); } int rank = gauss_jordan(mat); long long ans = 1; REP(i, rank) ans *= 2; cout << ans << '\n'; return 0; }