#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long add(long long a, long long b, long long m = MOD) {
  a %= m, b %= m;
  return (a + b) % m;
}
long long sub(long long a, long long b, long long m = MOD) {
  return add(a, m - b, m);
}
long long mult(long long a, long long b, long long m = MOD) {
  a %= m, b %= m;
  return 1ll * a * b % m;
}
long long fpow(long long x, long long y, long long m = MOD) {
  long long res = 1;
  if (y < 0) y += m - 1;
  while (y > 0) {
    if (y & 1) res = mult(res, x, m);
    x = mult(x, x, m);
    y >>= 1;
  }
  return res;
}
long long inv(long long a, long long md = MOD) {
  a %= md;
  if (a < 0) a += md;
  long long b = md, u = 0, v = 1;
  while (a) {
    long long t = b / a;
    b -= t * a;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  if (u < 0) u += md;
  return u;
}
vector<long long> fac, ifac;
void precomp(long long N = 1e5 + 5) {
  fac.assign(N, 1);
  ifac.assign(N, 1);
  for (long long i = 1; i < N; i++) fac[i] = mult(fac[i - 1], i);
  ifac[N - 1] = inv(fac[N - 1]);
  for (long long i = N - 2; i > 0; i--) ifac[i] = mult(ifac[i + 1], i + 1);
}
long long ncr(long long n, long long r) {
  if (r > n) return 0;
  return mult(fac[n], mult(ifac[r], ifac[n - r]));
}
vector<long long> pr, lp;
void sieve(long long N = 1e6 + 5) {
  lp.assign(N, 0);
  for (long long i = 2; i < N; i++) {
    if (!lp[i]) {
      lp[i] = i;
      pr.push_back(i);
    }
    for (auto &j : pr) {
      if (j > lp[i] || i * j >= N) break;
      lp[i * j] = j;
    }
  }
}
vector<long long> dp(1 << 19), pd = dp;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  sieve(71);
  precomp();
  unordered_map<long long, long long> id;
  for (long long i = 0; i < (long long)pr.size(); i++) {
    id[pr[i]] = i;
  }
  long long n;
  cin >> n;
  vector<long long> c(71);
  for (long long i = 0, x; i < n; i++) {
    cin >> x;
    c[x]++;
  }
  auto getMask = [&](long long x) {
    long long val = 0;
    for (long long j = 2; j * j <= x; j++) {
      while (x % j == 0) {
        x /= j;
        val ^= 1 << id[j];
      }
    }
    if (x > 1) {
      val ^= 1 << id[x];
    }
    return val;
  };
  dp[0] = 1;
  for (long long i = 0; i < 71; i++) {
    long long val = getMask(i);
    vector<long long> ways(2);
    for (long long choose = 0; choose <= c[i]; choose++) {
      ways[choose % 2] = add(ways[choose % 2], ncr(c[i], choose));
    }
    for (long long mask = 0; mask < (1 << 19); mask++) {
      pd[mask] = mult(dp[mask], ways[0]);
      pd[mask] = add(pd[mask], mult(dp[mask ^ val], ways[1]));
    }
    dp = pd;
  }
  cout << dp[0] - 1;
}
