#include <bits/stdc++.h>
using namespace std;
const int N = 200200;
const int mod = 1e9 + 7;
int cnt = 0, pr[N], p[N];
long long pw[N];
int dp[71][(1 << 19)];
int n, a[N];
int c[100];
int MASK[100];
inline void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  for (int i = 2; i <= 70; ++i)
    if (!p[i]) {
      pr[++cnt] = i;
      for (int j = i * i; j <= 70; j += i) p[j] = 1;
    }
  cin >> n;
  pw[0] = 1;
  for (int i = 1; i <= n; ++i) pw[i] = pw[i - 1] * 2 % mod;
  for (int i = 1; i <= n; ++i) cin >> a[i], c[a[i]]++;
  for (int i = 1; i <= 70; ++i) {
    int x = i;
    for (int j = 1; j <= cnt; ++j)
      while (x % pr[j] == 0) x /= pr[j], MASK[i] ^= (1 << (j - 1));
  }
  dp[0][0] = 1;
  for (int i = 1; i <= 70; ++i) {
    int x = c[i];
    for (int mask = 0; mask < (1 << 19); ++mask) {
      if (x) {
        add(dp[i][mask ^ MASK[i]], dp[i - 1][mask] * 1ll * pw[x - 1] % mod);
        add(dp[i][mask], dp[i - 1][mask] * 1ll * pw[x - 1] % mod);
      } else
        add(dp[i][mask], dp[i - 1][mask]);
    }
  }
  cout << (dp[70][0] + mod - 1) % mod;
  return 0;
}
