#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 7;
const int MOD = 1e9 + 7;
int h[71] = {0};
long long int ans[(1 << 20)][2] = {0};
int pr[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
            31, 37, 41, 43, 47, 53, 59, 61, 67};
long long int power(long long int a, long long int b, long long int mod) {
  long long int ans = 1;
  while (b > 0) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}
int main() {
  int n, i, j, a, y, x, c;
  long long int s;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a);
    h[a]++;
  }
  ans[0][0] = 1;
  for (i = 1; i <= 70; i++) {
    if (h[i]) {
      x = i, y = 0;
      for (j = 0; j < 19; j++) {
        c = 0;
        while (x % pr[j] == 0) x /= pr[j], c++;
        if (c & 1) y += 1 << j;
      }
      s = power(2, h[i] - 1, MOD);
      for (j = 0; j < (1 << 20); j++) {
        x = y ^ j;
        ans[x][1] = (ans[x][1] + (s * ans[j][0]) % MOD) % MOD;
        ans[j][1] = (ans[j][1] + (s * ans[j][0]) % MOD) % MOD;
      }
      for (j = 0; j < (1 << 20); j++) ans[j][0] = ans[j][1], ans[j][1] = 0;
    }
  }
  printf("%I64d\n", (ans[0][0] - 1 + MOD) % MOD);
  return 0;
}
