#include <bits/stdc++.h>
using namespace std;
const long long md = 1e9 + 7;
int freq[71] = {0};
unordered_map<int, int> memo[71];
int fac[75];
vector<int> primes;
long long power(long long a, long long p, long long m = 1e9 + 7,
                long long k = 0) {
  return p ? k = power(a, p / 2, m), (k * k % m) * (p & 1 ? a : 1) % m : 1;
}
int solve(int idx, int mask) {
  if (idx > 70) return !mask;
  if (memo[idx].find(mask) != memo[idx].end()) return memo[idx][mask];
  if (freq[idx] == 0) return memo[idx][mask] = solve(idx + 1, mask);
  long long ans = solve(idx + 1, mask) * power(2, freq[idx] - 1) % md;
  long long ans2 =
      solve(idx + 1, mask ^ fac[idx]) * power(2, freq[idx] - 1) % md;
  long long lol = (ans + ans2) % md;
  return memo[idx][mask] = lol;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, h, ans = 0, sum = 0, p, x, y;
  for (int i = 2; i < 71; ++i) {
    bool flag = 1;
    for (int j = 2; j < i; ++j)
      if (i % j == 0) flag = 0;
    if (flag) primes.push_back(i);
  }
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    ++freq[x];
    if (freq[x] > 1) continue;
    for (int j = 0; j < primes.size(); ++j) {
      int cnt = 0, tmp = x;
      while (tmp % primes[j] == 0) cnt ^= 1, tmp /= primes[j];
      if (cnt) fac[x] |= (1 << j);
    }
  }
  cout << (solve(1, 0) - 1 + md) % md;
}
