#include using namespace std; namespace arithmetic { template class Addition { public: template T operator+(const V& v) const { return T(static_cast(*this)) += v; } }; template class Subtraction { public: template T operator-(const V& v) const { return T(static_cast(*this)) -= v; } }; template class Multiplication { public: template T operator*(const V& v) const { return T(static_cast(*this)) *= v; } }; template class Division { public: template T operator/(const V& v) const { return T(static_cast(*this)) /= v; } }; template class Modulus { public: template T operator%(const V& v) const { return T(static_cast(*this)) %= v; } }; } template class IndivisibleArithmetic : public arithmetic::Addition, public arithmetic::Subtraction, public arithmetic::Multiplication {}; template class Arithmetic : public IndivisibleArithmetic, public arithmetic::Division {}; template class Bitwise { public: T operator&(const T& v) const { T res(static_cast(*this)); return res &= v; } T operator|(const T& v) const { T res(static_cast(*this)); return res |= v; } T operator^(const T& v) const { T res(static_cast(*this)); return res ^= v; } }; template int least_bit(T n) { static_assert(sizeof(T) == 4 || sizeof(T) == 8, "unsupported size"); if (sizeof(T) == 4) return __builtin_ffs(n) - 1; if (sizeof(T) == 8) return __builtin_ffsll(n) - 1; } template int most_bit(T n) { static_assert(sizeof(T) == 4 || sizeof(T) == 8, "unsupported size"); if (sizeof(T) == 4) return n ? 31 - __builtin_clz(n) : -1; if (sizeof(T) == 8) return n ? 63 - __builtin_clzll(n) : -1; } template int count_bit(T n) { static_assert(sizeof(T) == 4 || sizeof(T) == 8, "unsupported size"); if (sizeof(T) == 4) return __builtin_popcount(n); if (sizeof(T) == 8) return __builtin_popcountll(n); } class Bitset : public Bitwise { private: int arraySize(int n) const { return (n + 63) / 64; } void resize(int n) { val.resize(arraySize(n) + 1); } public: vector val; class reference { private: friend class Bitset; vector::iterator val; int pos; reference(vector::iterator val, int pos) : val(val), pos(pos) {} public: reference operator=(const reference& r) { if ((bool)r) *val |= 1ull << pos; else *val &= ~(1ull << pos); return *this; } reference operator=(const bool b) { if (b) *val |= 1ull << pos; else *val &= ~(1ull << pos); return *this; } operator bool() const { return *val >> pos & 1; } }; Bitset() {} Bitset(int n) : val(arraySize(n), 0) {} reference operator[](int n) { if (arraySize(n) >= (int)val.size()) resize(n); return reference(val.begin() + n / 64, n % 64); } bool operator[](int n) const { if (arraySize(n) >= (int)val.size()) return false; return val[n / 64] >> n % 64 & 1; } Bitset operator&=(const Bitset& b) { if (val.size() < b.val.size()) val.resize(b.val.size()); for (size_t i = 0; i < val.size(); ++i) { if (i < b.val.size()) val[i] &= b.val[i]; } return *this; } Bitset operator|=(const Bitset& b) { if (val.size() < b.val.size()) val.resize(b.val.size()); for (size_t i = 0; i < val.size(); ++i) { if (i < b.val.size()) val[i] |= b.val[i]; } return *this; } Bitset operator^=(const Bitset& b) { if (val.size() < b.val.size()) val.resize(b.val.size()); for (size_t i = 0; i < val.size(); ++i) { if (i < b.val.size()) val[i] ^= b.val[i]; } return *this; } int count() { return accumulate(val.begin(), val.end(), 0, [](int a, unsigned long long b){return a + count_bit(b);}); } bool parity() { return accumulate(val.begin(), val.end(), 0, [](int a, unsigned long long b){return a ^ __builtin_parityll(b);}); } }; class BitsetMatrix : public Arithmetic { private: vector val; public: BitsetMatrix(int n) : val(n) {} BitsetMatrix(int n, int m) : val(n, Bitset(m)) {} Bitset& operator[](int n) { return val[n]; } const Bitset& operator[](int n) const { return val[n]; } BitsetMatrix operator+=(const BitsetMatrix& m) { for (int i = 0; i < size(); ++i) val[i] ^= m[i]; return *this; } BitsetMatrix operator-=(const BitsetMatrix& m) { for (int i = 0; i < size(); ++i) val[i] ^= m[i]; return *this; } BitsetMatrix operator*=(const BitsetMatrix& _m) { BitsetMatrix m = _m.transpose(), res(size()); for (int i = 0; i < size(); ++i) res[i] = *this * m[i]; return *this = res.transpose(); } BitsetMatrix operator*(const BitsetMatrix& m) const { auto res(static_cast(*this)); return res *= m; } Bitset operator*(const Bitset& v) const { Bitset res(size()); for (int i = 0; i < size(); ++i) res[i] = (val[i] & v).parity(); return res; } BitsetMatrix transpose() const { BitsetMatrix res(size()); for (int i = 0; i < size(); ++i) { for (int j = 0; j < size(); ++j) { res[i][j] = (*this)[j][i]; } } return res; } int size() const { return val.size(); } int rank() const { int n = size(), res = 0; BitsetMatrix mat = *this; for (int i = 0; i < n; ++i) { int p = i; for (int j = i + 1; j < n; ++j) { if (abs(mat[j][i]) > abs(mat[p][i])) p = j; } swap(mat[i], mat[p]); if (mat[i][i] == 0) continue; else ++res; for (int j = 0; j < n; ++j) { if (i == j) continue; if (!mat[j][i]) continue; mat[j] ^= mat[i]; } } return res; } }; int main() { int n; cin >> n; BitsetMatrix m(n); for (int i = 0; i < n; ++i) { long long a; cin >> a; for (int j = 0; a; ++j, a /= 2) m[i][j] = a % 2; } cout << (1ll << m.rank()) << endl; }