#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, LOG = 20, K = 70 + 5, mod = 1e9 + 7;
bool is_prime(int n) {
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
int sum(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  if (a < 0) a += mod;
  return a;
}
int mult(int a, int b) { return (1LL * a * b) % mod; }
int n, a[N], bit[N], dp[2][(1 << LOG)], ways[K][2], cnt[N], fact[N], rev[N];
vector<int> p;
int pw(int a, int b) {
  if (!b) return 1;
  int ans = pw(a, b / 2);
  ans = mult(ans, ans);
  if (b & 1) ans = mult(ans, a);
  return ans;
}
void prep() {
  fact[0] = 1;
  for (int i = 1; i < N; i++) fact[i] = mult(fact[i - 1], i);
  rev[N - 1] = pw(fact[N - 1], mod - 2);
  for (int i = N - 2; ~i; i--) rev[i] = mult(rev[i + 1], i + 1);
  for (int i = 1; i <= 70; i++) {
    for (int j = 0; j < p.size(); j++) {
      int num = 0;
      int x = i;
      while (x % p[j] == 0) x /= p[j], num++;
      num &= 1;
      bit[i] += (1 << j) * num;
    }
  }
}
int c(int i, int j) {
  if (i < j) return 0;
  return mult(fact[i], mult(rev[i - j], rev[j]));
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  for (int i = 2; i <= 70; i++) {
    if (is_prime(i)) p.push_back(i);
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  prep();
  for (int i = 1; i <= 70; i++)
    for (int j = 0; j <= cnt[i]; j++)
      ways[i][j & 1] = sum(ways[i][j & 1], c(cnt[i], j));
  dp[0][0] = 1;
  for (int i = 1; i <= 70; i++) {
    for (int mask = 0; mask < (1 << 19); mask++) dp[i & 1][mask] = 0;
    for (int mask = 0; mask < (1 << 19); mask++) {
      dp[i & 1][mask] =
          sum(dp[i & 1][mask], mult(dp[(i - 1) & 1][mask], ways[i][0]));
      dp[i & 1][mask ^ bit[i]] = sum(dp[i & 1][mask ^ bit[i]],
                                     mult(dp[(i - 1) & 1][mask], ways[i][1]));
    }
  }
  cout << sum(dp[70 & 1][0], -1) << "\n";
}
