#include <bits/stdc++.h>
using namespace std;
const int MAXM = 20;
const int MAXN = 71;
const int_fast64_t mod = 1e9 + 7;
vector<int> prime;
int n, m, cnt[MAXN], msk[MAXN], maxx, ct[MAXN][2], tag;
int_fast64_t f[2][1 << MAXM];
bool isprime(int x) {
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
void calprime() {
  for (int i = 2; i <= 70; i++)
    if (isprime(i)) prime.push_back(i);
}
int_fast64_t qpow(int_fast64_t a, int_fast64_t b) {
  int_fast64_t res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return res;
}
void init() {
  calprime();
  for (int i = 2; i <= 70; i++) {
    int x = i;
    for (int k = 0; k < (int)prime.size(); k++) {
      while (x % prime[k] == 0) {
        msk[i] ^= (1 << k);
        x /= prime[k];
      }
    }
  }
  m = prime.size();
  f[1][0] = 1;
  for (int i = 1; i <= 70; i++) {
    if (!cnt[i]) continue;
    ct[i][0] = qpow(2, cnt[i] - 1) - 1;
    ct[i][1] = qpow(2, cnt[i] - 1);
  }
}
void solve() {
  for (int i = 1; i <= maxx; i++, tag ^= 1) {
    for (int bit = 0; bit < (1 << m); bit++) f[tag][bit] = f[tag ^ 1][bit];
    for (int bit = 0; bit < (1 << m); bit++) {
      f[tag][bit ^ msk[i]] =
          (f[tag][bit ^ msk[i]] + f[tag ^ 1][bit] * ct[i][1]) % mod;
      f[tag][bit] = (f[tag][bit] + f[tag ^ 1][bit] * ct[i][0]) % mod;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    maxx = max(maxx, x);
    cnt[x]++;
  }
  init();
  solve();
  cout << (f[tag ^ 1][0] - 1 + mod) % mod << endl;
  return 0;
}
