#include <bits/stdc++.h>
using namespace std;
vector<int> primes;
bool is_prime(int n) {
  for (int i = 2; i * i <= n; ++i)
    if (n % i == 0) return false;
  return true;
}
int to_mask(int n) {
  int res = 0;
  for (int i = (0); i < (primes.size()); ++i) {
    int f = 0;
    while (n % primes[i] == 0) {
      n /= primes[i];
      f ^= 1;
    }
    res |= f << i;
  }
  return res;
}
int a[100500];
int used[100500] = {};
const int MOD = 1e9 + 7;
int main() {
  for (int i = (2); i < (70); ++i)
    if (is_prime(i)) primes.push_back(i);
  int n;
  int q;
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) {
    scanf("%d", &q);
    a[i] = to_mask(q);
  }
  int dim = 0;
  for (int b = 1 << (primes.size() - 1); b; b /= 2) {
    int ind = -1;
    for (int i = (0); i < (n); ++i)
      if (!used[i])
        if (a[i] & b) ind = i;
    if (ind >= 0) {
      used[ind] = true;
      ++dim;
      for (int i = (0); i < (n); ++i)
        if (!used[i] && (a[i] & b)) a[i] ^= a[ind];
    }
  }
  int res = 1;
  int p = n - dim;
  for (int i = (0); i < (p); ++i) res = (res * 2) % MOD;
  res = (res + MOD - 1) % MOD;
  printf("%d\n", res);
}
