#include <bits/stdc++.h>
const int mod = 1e9 + 7;
int n, a[100010], cnt[80];
int pow(int a, int x) {
  int res = 1;
  for (; x; x >>= 1) {
    if (x & 1) res = 1ll * res * a % mod;
    a = 1ll * a * a % mod;
  }
  return res;
}
const int p[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
                 31, 37, 41, 43, 47, 53, 59, 61, 67};
const int pt = 19;
int f[2][1 << 19], po[100010];
int main() {
  scanf("%d", &n);
  po[0] = 1;
  for (int i = 1; i <= n; i++)
    scanf("%d", a + i), cnt[a[i]]++, po[i] = po[i - 1] << 1, po[i] %= mod;
  f[0][0] = 1;
  int I = 0;
  for (int i = 1; i <= 70; i++) {
    if (!cnt[i]) continue;
    I ^= 1;
    memset(f[I], 0, sizeof f[I]);
    for (int s = 0; s < (1 << 19); ++s) {
      int x = i, ss = s;
      for (int j = 0; j < pt && p[j] <= x; j++) {
        while (x % p[j] == 0) x /= p[j], ss ^= (1 << j);
      }
      f[I][ss] += 1ll * f[I ^ 1][s] * po[cnt[i] - 1] % mod;
      f[I][s] += 1ll * f[I ^ 1][s] * po[cnt[i] - 1] % mod;
      f[I][ss] %= mod, f[I][s] %= mod;
    }
  }
  printf("%d\n", (f[I][0] - 1 + mod) % mod);
}
