#include <bits/stdc++.h>
using namespace std;
const int MX = 71;
const long long INF = 1e18;
const long long md = 1e9 + 7;
int N, M, k;
int dp[MX][534287];
int cnt[MX];
bool is(int n) {
  if (n == 2) return 1;
  if (n % 2 == 0 || n < 2) return 0;
  for (int i = 3; i * i <= n; i += 2)
    if (n % i == 0) return 0;
  return 1;
}
int mapping[MX];
int masks[MX];
long long fact[100010];
long long inv[100010];
long long pw(long long x, long long p) {
  if (p == 0) return 1;
  long long res = pw(x, p / 2);
  res = (res * res) % md;
  if (p & 1) res = (res * x) % md;
  return res;
}
long long C(long long n, long long k) {
  return ((fact[n] * inv[k]) % md * inv[n - k]) % md;
}
long long odd[MX], even[MX];
int calc(int num, int mask) {
  if (num == MX) {
    return mask == 0;
  }
  int &ret = dp[num][mask];
  if (ret != -1) return ret;
  ret = 0;
  long long c1 = 0, c2 = 0;
  c1 = even[num] * calc(num + 1, mask);
  c2 = odd[num] * calc(num + 1, mask ^ masks[num]);
  ret = ((c1 % md) + (c2 % md)) % md;
  return ret;
}
int main() {
  fact[0] = 1;
  inv[0] = pw(1, md - 2);
  for (int i = 1; i < 100005; i++) {
    fact[i] = (fact[i - 1] * i) % md;
    inv[i] = pw(fact[i], md - 2);
  }
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &M);
    ++cnt[M];
  }
  memset(mapping, -1, sizeof mapping);
  int cur = 0;
  for (int i = 2; i < MX; i++)
    if (is(i)) mapping[i] = cur++;
  for (int i = 2; i < MX; i++) {
    if (cnt[i] == 0) continue;
    int num = i;
    for (int j = 2; j * j <= num; j++) {
      while (num % j == 0) {
        masks[i] ^= (1 << mapping[j]);
        num /= j;
      }
    }
    if (num > 1) masks[i] ^= (1 << mapping[num]);
  }
  for (int i = 2; i < MX; i++) {
    for (int j = 0; j <= cnt[i]; j++) {
      if (j % 2 == 0) {
        even[i] += C(cnt[i], j);
        even[i] %= md;
      } else {
        odd[i] += C(cnt[i], j);
        odd[i] %= md;
      }
    }
  }
  memset(dp, -1, sizeof(dp));
  long long ans = calc(2, 0);
  ans = (ans - 1 + md) % md;
  long long extra = pw(2, cnt[1]) - 1;
  long long ans2 = (extra * ans) % md;
  long long t = (ans2 + extra) % md;
  ans = (ans + t) % md;
  cout << ans;
  return 0;
}
