#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int mod2 = 998244353;
long long exp(long long base, long long e, long long md);
void fact_init(int n, int md);
long long komb(int a, int b, int md);
vector<long long> fact;
vector<long long> inv_fact;
long long exp(long long base, long long e, long long md) {
  long long mul = base % md;
  long long res = 1;
  while (e) {
    if (e % 2) res = (res * mul) % md;
    e /= 2;
    mul = mul * mul % md;
  }
  return res;
}
void fact_init(int n, int md) {
  fact.resize(n + 5);
  inv_fact.resize(n + 5);
  fact[0] = inv_fact[0] = 1;
  for (int i = 1; i <= n; i++) {
    fact[i] = (fact[i - 1] * i) % md;
    inv_fact[i] = exp(fact[i], md - 2, md);
  }
}
long long komb(int a, int b, int md) {
  if (a < b) return 0;
  return fact[a] * (inv_fact[a - b] * inv_fact[b] % md) % md;
}
const int N = 1e5 + 5;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int pw2[N];
  pw2[0] = 1;
  for (int i = 1; i < N; i++) pw2[i] = pw2[i - 1] * 2 % mod;
  int n;
  cin >> n;
  int cnt[71] = {};
  for (int i = 0; i < (n); i++) {
    int s;
    cin >> s;
    cnt[s]++;
  }
  const int S = 19;
  int primeList[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
                     31, 37, 41, 43, 47, 53, 59, 61, 67};
  int idx[68] = {};
  for (int i = 0; i < S; i++) idx[primeList[i]] = i;
  int ways[1 << S] = {};
  ways[0] = 1;
  for (int num = 1; num <= 70; num++) {
    if (cnt[num] == 0) continue;
    vector<int> primes;
    int foo = num;
    for (int i = 2; i * i <= foo; i++) {
      if (foo % i) continue;
      bool odd = false;
      for (; foo % i == 0; foo /= i, odd ^= 1) {
      }
      if (odd) primes.push_back(i);
    }
    if (foo > 1) primes.push_back(foo);
    int mask = 0;
    for (int prime : primes) {
      mask |= 1 << idx[prime];
    }
    int tot = cnt[num];
    int new_ways[1 << S] = {};
    for (int i = 0; i < (1 << S); i++) {
      new_ways[i ^ mask] =
          (new_ways[i ^ mask] + (long long)ways[i] * pw2[tot - 1]) % mod;
      new_ways[i] = (new_ways[i] + (long long)ways[i] * pw2[tot - 1]) % mod;
    }
    for (int i = 0; i < (1 << S); i++) {
      ways[i] = new_ways[i];
    }
  }
  cout << (ways[0] - 1 + mod) % mod << "\n";
}
