#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
const long double pi = acos(-1);
const int MOD = 1e9 + 7;
int p[71], mapa[71], mask[71];
int caras[71];
int pot2[100010];
void sieve() {
  int col = 0;
  p[1] = 0;
  for (int i = 2; i <= 70; i++) {
    if (!p[i]) {
      mapa[i] = col++;
      for (int j = 2 * i; j <= 70; j += i) p[j] = 1;
    }
  }
}
void pre() {
  for (int i = 2; i <= 70; i++) {
    int cara = 0;
    for (int j = 2; j <= 70; j++) {
      if (p[j]) continue;
      int n = i;
      while (n % j == 0) cara ^= (1 << mapa[j]), n /= j;
    }
    mask[i] = cara;
  }
}
int dp[71][1 << 19], n;
int solve(int idx, int nmask) {
  if (idx == 71) return (nmask == 0);
  long long ret = 0;
  if (dp[idx][nmask] != -1) return dp[idx][nmask];
  if (caras[idx] == 0) return dp[idx][nmask] = solve(idx + 1, nmask);
  ret = (solve(idx + 1, nmask) + solve(idx + 1, nmask ^ mask[idx])) *
        (long long)pot2[caras[idx] - 1];
  return dp[idx][nmask] = ret % MOD;
}
int main() {
  sieve();
  pre();
  memset(dp, -1, sizeof(dp));
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    caras[x]++;
  }
  pot2[0] = 1;
  for (int i = 1; i <= n; i++) pot2[i] = (pot2[i - 1] * 2) % MOD;
  long long resp = (solve(0, 0) + MOD - 1) % MOD;
  cout << resp << endl;
  return 0;
}
