#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
void fast_in_out() {
  std::ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
}
int dx[] = {0, 0, -1, 1, -1, 1, -1, 1, 0};
int dy[] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
const int N = 2e5 + 5, M = 500 + 5, mod = 1e9 + 7;
vector<int> prm;
int adj[(1 << 20)];
int pm[71];
long long dp[2][(1 << 20)];
void sieve() {
  prm.push_back(2);
  for (int i = 4; i < 71; i += 2) pm[i] = 1;
  for (int i = 3; i < 71; i += 2) {
    if (!pm[i]) {
      prm.push_back(i);
      for (int j = i + i; j < 71; j += i) pm[j] = 1;
    }
  }
  for (int i = 0; i < prm.size(); i++) {
    int p = prm[i];
    for (int k = 2; k < 71; k++) {
      int n = k;
      while (n % p == 0) adj[k] ^= (1 << i), n /= p;
    }
  }
}
long long po[N];
int main() {
  fast_in_out();
  sieve();
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    mp[x]++;
  }
  po[0] = 1;
  for (int i = 1; i < N; i++) {
    po[i] = po[i - 1] << 1;
    if (po[i] >= mod) po[i] -= mod;
  }
  dp[0][0] = 1;
  for (int i = 0; i < 71; i++) {
    long long x = 1, y = 0;
    if (mp.find(i) != mp.end()) x = y = po[mp[i] - 1];
    for (int mask = 0; mask < (1 << 20); ++mask) {
      dp[(i + 1) & 1][mask ^ adj[i]] += (dp[i & 1][mask] * y);
      dp[(i + 1) & 1][mask ^ adj[i]] %= mod;
      dp[(i + 1) & 1][mask] += (dp[i & 1][mask] * x);
      dp[(i + 1) & 1][mask] %= mod;
    }
    for (int mask = 0; mask < (1 << 20); ++mask) dp[i & 1][mask] = 0;
  }
  dp[1][0] -= 1;
  if (dp[1][0] < 0) dp[1][0] += mod;
  cout << dp[1][0];
  return 0;
}
