#include <bits/stdc++.h>
using namespace std;
template <class T = long long int>
T nxt() {
  T x;
  cin >> x;
  return x;
}
long long int pw(long long int a, long long int b, long long int mod) {
  if (!b) return 1;
  if (b & 1) return a * pw(a * a % mod, b / 2, mod) % mod;
  return pw(a * a % mod, b / 2, mod) % mod;
}
const long long int N = 1e5 + 10;
const long long int MOD = 1e9 + 7;
long long int n, A[N], B[N];
vector<long long int> primes = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
                                31, 37, 41, 43, 47, 53, 59, 61, 67};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> A[i];
    for (long long int j = 0; j < primes.size(); j++) {
      while (A[i] % primes[j] == 0) {
        A[i] /= primes[j];
        B[i] ^= (1ll << j);
      }
    }
  }
  long long int p = 0;
  for (long long int j = 0; j < primes.size() && p < n; j++) {
    for (long long int k = p; k < n; k++) {
      if (B[k] & (1 << j)) {
        swap(B[k], B[p]);
        break;
      }
    }
    if (!(B[p] & (1ll << j))) continue;
    for (long long int k = 0; k < n; k++) {
      if (k == p) continue;
      if (B[k] & (1ll << j)) B[k] ^= B[p];
    }
    p++;
  }
  cout << (pw(2, n - p, MOD) + MOD - 1) % MOD << '\n';
  return 0;
}
