#include <bits/stdc++.h>
using namespace std;
int dadsadasda;
const int INF = 0x3f3f3f3f;
const long long LLINF = 1e18;
const int MAXN = 1e5 + 10;
const long long MOD = 1e9 + 7;
int N;
int A[MAXN];
vector<int> Ps;
int CNT[75];
long long DP[1 << 19], NEW_DP[1 << 19];
long long FACT[MAXN];
long long bpow(long long b, long long e) {
  long long ret = 1;
  while (e > 0) {
    if (e & 1) ret = (ret * b) % MOD;
    b = (b * b) % MOD;
    e >>= 1;
  }
  return ret;
}
long long pick(int n, int k) {
  if (k > n) return 0;
  return FACT[n] * bpow((FACT[k] * FACT[n - k]) % MOD, MOD - 2);
}
int main() {
  dadsadasda = scanf("%d", &N);
  for (int i = 0; i < N; i++) dadsadasda = scanf("%d", &A[i]);
  for (int i = 2; i < 70; i++) {
    bool good = true;
    for (int d = 2; d < i; d++) good &= i % d != 0;
    if (good) Ps.push_back(i);
  }
  FACT[0] = 1;
  for (int i = 1; i < N + 1; i++) FACT[i] = (FACT[i - 1] * i) % MOD;
  for (int i = 0; i < N; i++) CNT[A[i]]++;
  DP[0] = 1;
  for (int n = 1; n < 71; n++) {
    int msk = 0;
    for (int i = 0; i < (int)Ps.size(); i++) {
      int aux_n = n;
      int cnt = 0;
      while (aux_n % Ps[i] == 0) {
        aux_n /= Ps[i];
        cnt++;
      }
      if (cnt & 1) msk |= (1 << i);
    }
    long long odd = 0, even = 0;
    for (int c = 0; c < CNT[n] + 1; c++) {
      if (c & 1)
        odd = (odd + pick(CNT[n], c)) % MOD;
      else
        even = (even + pick(CNT[n], c)) % MOD;
    }
    for (int i = 0; i < 1 << 19; i++)
      NEW_DP[i] = (DP[i] * even + DP[i ^ msk] * odd) % MOD;
    for (int i = 0; i < 1 << 19; i++) DP[i] = NEW_DP[i];
  }
  printf("%lld\n", DP[0] - 1);
  return 0;
}
