#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 3e6 + 10;
const int M = 1e5 + 10;
int c[101], p[30], m[101];
int n, x, cnt, now, all;
bool flag;
long long two[M], f[2][N];
void up(long long &a, long long b) { a = (a + b) % mod; }
void init() {
  two[0] = 1;
  for (int i(1); i <= (100000); ++i) two[i] = two[i - 1] * 2 % mod;
  scanf("%d", &n);
  for (int i(1); i <= (n); ++i) scanf("%d", &x), ++c[x];
  for (int i(2); i <= (70); ++i) {
    flag = true;
    for (int j(2); j <= (i - 1); ++j)
      if (i % j == 0) {
        flag = false;
        break;
      }
    if (flag) p[cnt++] = i;
  }
  for (int i(1); i <= (70); ++i) {
    int y = i;
    for (int j(0); j <= (cnt - 1); ++j) {
      int tt = 0;
      while (y % p[j] == 0) y /= p[j], ++tt;
      if (tt & 1) m[i] |= (1 << j);
    }
  }
}
int main() {
  init();
  all = (1 << cnt) - 1;
  for (int i(2); i <= (70); ++i) {
    if (c[i] == 0) continue;
    memset(f[now ^ 1], 0, sizeof f[now ^ 1]);
    long long a1 = two[c[i] - 1], a2 = (a1 - 1 + mod) % mod;
    up(f[now ^ 1][m[i]], a1);
    up(f[now ^ 1][0], a2);
    for (int mask(0); mask <= (all); ++mask)
      up(f[now ^ 1][mask ^ m[i]], f[now][mask] * a1 % mod);
    for (int mask(0); mask <= (all); ++mask)
      up(f[now ^ 1][mask], f[now][mask] * a2 % mod);
    for (int mask(0); mask <= (all); ++mask) up(f[now ^ 1][mask], f[now][mask]);
    now ^= 1;
  }
  long long ans = f[now][0];
  ans = (ans * two[c[1]]) % mod;
  up(ans, (two[c[1]] - 1 + mod) % mod);
  printf("%lld\n", ans);
  return 0;
}
