#include <bits/stdc++.h>
using namespace std;
const unsigned ELEMENT_LIMIT = 90;
const long long M = 1e9 + 7;
vector<int> sz;
vector<vector<long long> > basis;
vector<bool> is_prime(ELEMENT_LIMIT, 1);
vector<int> primes;
int BITS_LIMIT;
void precompute() {
  is_prime[0] = is_prime[1] = 0;
  for (unsigned i = 4; i <= ELEMENT_LIMIT; i += 2) is_prime[i] = 0;
  for (unsigned i = 3; i * i <= ELEMENT_LIMIT; i += 2) {
    if (is_prime[i]) {
      for (unsigned j = i * i; j <= ELEMENT_LIMIT; j += i) is_prime[j] = 0;
    }
  }
  for (unsigned i = 0; i <= ELEMENT_LIMIT; ++i) {
    if (is_prime[i]) primes.push_back(i);
  }
  BITS_LIMIT = primes.size();
}
map<int, int> pf(long long n) {
  map<int, int> res;
  for (long long i = 2; i * i <= n; ++i) {
    while (n % i == 0) {
      ++res[i];
      n /= i;
    }
  }
  if (n > 1) ++res[n];
  return res;
}
void insert_to_basis(unsigned index, long long mask) {
  vector<long long> &current_basis = basis[index];
  int &current_sz = sz[index];
  for (unsigned i = 0; i < BITS_LIMIT; ++i) {
    if (!(mask & (1LL << i))) continue;
    if (!current_basis[i]) {
      current_basis[i] = mask;
      ++current_sz;
      return;
    }
    mask ^= current_basis[i];
  }
}
bool check_if_possible(unsigned index, long long mask) {
  const vector<long long> &current_basis = basis[index];
  for (unsigned i = 0; i < BITS_LIMIT; ++i) {
    if (!(mask & (1LL << i))) continue;
    if (current_basis[i])
      mask ^= current_basis[i];
    else
      return 0;
  }
  return !mask;
}
long long bin_expo(long long a, long long b, long long m) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % m;
    }
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
long long get_mask(long long num) {
  map<int, int> prime_f = pf(num);
  long long mask = 0;
  for (unsigned i = 0; i < BITS_LIMIT; ++i) {
    if (prime_f[primes[i]] & 1) mask = (mask | (1LL << i));
  }
  return mask;
}
long long compute_res(unsigned l, int k) {
  if (check_if_possible(l, get_mask(k))) {
    return bin_expo(2, l - sz[l], M);
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  precompute();
  unsigned n, q;
  cin >> n;
  basis.resize(n + 1);
  sz.resize(n + 1);
  basis[0] = vector<long long>(BITS_LIMIT + 1, 0);
  sz[0] = 0;
  int temp;
  for (unsigned i = 1; i <= n; ++i) {
    cin >> temp;
    basis[i] = basis[i - 1];
    sz[i] = sz[i - 1];
    insert_to_basis(i, get_mask(temp));
  }
  cout << (compute_res(n, 1) - 1) % M;
}
