#include <bits/stdc++.h>
using namespace std;
const int D = 19;
const long long MOD = 1e9 + 7;
int primes[19] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
                  31, 37, 41, 43, 47, 53, 59, 61, 67};
int basis[D];
int dim = 0;
void insert(int v) {
  while (v > 0) {
    int d = __builtin_ctz(v & (-v));
    if (basis[d] == -1) {
      basis[d] = v;
      dim++;
      return;
    } else
      v ^= basis[d];
  }
}
long long mod_pow(long long base, long long exp) {
  if (exp == 0) return 1;
  if (exp & 1)
    return (base * mod_pow(base, exp - 1)) % MOD;
  else
    return mod_pow((base * base) % MOD, exp >> 1);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  memset(basis, -1, sizeof basis);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    int v = 0;
    for (int j = 0; j < D; j++) {
      int e = 0;
      while (x % primes[j] == 0) {
        e++;
        x /= primes[j];
      }
      if (e & 1) v |= 1 << j;
    }
    insert(v);
  }
  cout << mod_pow(2, n - dim) - 1 << endl;
  return 0;
}
