#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long linf = 1e18;
const int N = 100000 + 10;
const double eps = 1e-10;
const int mo = 1e9 + 7;
int n;
int t;
long long f[2][100];
long long dp[2][(1 << 19)];
int mask[100];
int cnt;
int cur, nxt;
bool is_prime(int x) {
  int top = sqrt(x + 0.5);
  for (int i = 2; i <= top; i++)
    if (x % i == 0) return 0;
  return 1;
}
void pre() {
  for (int i = 2; i <= 70; i++) {
    if (!is_prime(i)) continue;
    for (int j = 1; j <= 70; j++) {
      int x = j;
      while (x % i == 0) {
        x /= i;
        mask[j] ^= (1 << cnt);
      }
    }
    ++cnt;
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= 70; i++) f[0][i] = 1;
  pre();
  for (int i = 1; i <= n; i++) {
    cin >> t;
    f[0][t] = f[1][t] = (f[0][t] + f[1][t]) % mo;
  }
  cur = 1, nxt = 0;
  dp[0][0] = 1;
  for (int i = 1; i <= 70; i++) {
    nxt ^= 1, cur ^= 1;
    for (int msk = 0; msk < (1 << 19); msk++) {
      dp[nxt][msk ^ mask[i]] += dp[cur][msk] * f[1][i];
      dp[nxt][msk] += dp[cur][msk] * f[0][i];
      dp[nxt][msk ^ mask[i]] %= mo;
      dp[nxt][msk] %= mo;
    }
    for (int msk = 0; msk < (1 << 19); msk++) dp[cur][msk] = 0;
  }
  cur ^= 1;
  cout << dp[cur][0] - 1 << endl;
  return 0;
}
