#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 3;
const long long M = 1e9 + 7;
int primes[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
                31, 37, 41, 43, 47, 53, 59, 61, 67};
int n;
long long f[2][1 << 19], odd[71], even[71], cnt[71], mask[71];
int Fact(int x) {
  int ans = 0;
  for (int i = 18; i >= 0; --i) {
    ans <<= 1;
    int cnt = 0;
    while (x % primes[i] == 0) {
      ++cnt;
      x /= primes[i];
    }
    ans ^= (cnt & 1);
  }
  return ans;
}
long long expl(long long a, long long b) {
  long long ans = 1;
  for (; b; b >>= 1) {
    if (b & 1) ans = (ans * a) % M;
    a = (a * a) % M;
  }
  return ans;
}
int main() {
  memset(cnt, 0, sizeof(cnt));
  scanf("%d", &n);
  int mx = 1;
  for (int i = 1; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    ++cnt[x];
    mx = max(x, mx);
  }
  for (int i = 1; i <= mx; ++i) mask[i] = Fact(i);
  for (int i = 1; i <= mx; ++i) {
    if (cnt[i] == 0) {
      odd[i] = 0;
      even[i] = 1;
      continue;
    }
    odd[i] = even[i] = expl(2, cnt[i] - 1);
  }
  f[0][0] = 1;
  int p = 1, q = 0;
  for (int i = 1; i <= mx; ++i, swap(p, q)) {
    for (int j = 0; j < (1 << 19); ++j) f[p][j] = 0;
    for (int j = 0; j < (1 << 19); ++j) {
      f[p][j] = (f[p][j] + f[q][j] * even[i] % M) % M;
      f[p][j ^ mask[i]] = (f[p][j ^ mask[i]] + f[q][j] * odd[i] % M) % M;
    }
  }
  printf("%I64d", (f[q][0] - 1 + M) % M);
  return 0;
}
