#include <bits/stdc++.h>
using namespace std;
long long int pw(long long int a, long long int b, long long int md) {
  if (!b) return 1;
  if (b & 1) return a * pw(a * a % md, b / 2, md) % md;
  return pw(a * a % md, b / 2, md) % md;
}
const long long int MAXN = 1e5 + 10;
const long long int INF = 8e18;
const long long int MOD = 1e9 + 7;
const long long int LOG = 32;
const long long int BLOCK = 320;
const long double PI = acos(-1);
const long double SADAT = 7.84e-17;
long long int n, a[MAXN], cnt[80], ind[80], timer, p[80], spf[80],
    dp[2][1LL << 20];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (long long int i = 2; i < 80; i++) {
    if (spf[i]) continue;
    ind[i] = timer++;
    spf[i] = i;
    for (long long int j = i * i; j < 80; j += i) spf[j] = i;
  }
  for (long long int i = 2; i < 80; i++) {
    long long int x = i;
    while (x > 1) {
      p[i] ^= (1LL << ind[spf[x]]);
      x /= spf[x];
    }
  }
  cin >> n;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  dp[0][0] = 1;
  for (long long int i = 1; i <= 70; i++) {
    if (cnt[i] == 0) {
      continue;
    }
    fill(dp[1], dp[1] + (1LL << 20), 0);
    long long int t = pw(2, cnt[i] - 1, MOD);
    for (long long int j = 0; j < (1LL << 20); j++) {
      dp[1][j] = (dp[1][j] + t * dp[0][j] % MOD) % MOD;
      dp[1][j ^ p[i]] = (dp[1][j ^ p[i]] + t * dp[0][j] % MOD) % MOD;
    }
    copy(dp[1], dp[1] + (1LL << 20), dp[0]);
  }
  cout << (dp[0][0] - 1 + MOD) % MOD << '\n';
  return 0;
}
