#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
long long mul(long long a, long long b) { return (a * b) % (1000000007); }
long long add(long long a, long long b) { return (a + b) % (1000000007); }
long long sub(long long a, long long b) {
  return ((a - b) % (1000000007) + (1000000007)) % (1000000007);
}
void upd(long long &a, long long b) {
  a = (a % (1000000007) + b % (1000000007)) % (1000000007);
}
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int a[123456];
int p[(123456)], tot;
bool b[(123456)] = {0};
void make_prime(int n) {
  tot = 0;
  for (int i = 2; i <= n; i++) {
    if (!b[i]) p[++tot] = i;
    for (int j = 1; j <= tot; j++) {
      if (i * p[j] > n) break;
      b[i * p[j]] = 1;
      if (i % p[j] == 0) break;
    }
  }
}
unsigned long long c[(123456)];
int n;
int gauss(int n, unsigned long long *a) {
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++)
      if (a[j] > a[i]) swap(a[i], a[j]);
    if (a[i] == 0) return i - 1;
    for (int k = 1; k <= n; k++)
      if (i ^ k) a[k] = min(a[k], a[k] ^ a[i]);
  }
  return n;
}
int main() {
  make_prime(70);
  int n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= tot; j++)
      if (a[i] % p[j] == 0) {
        int t = 0;
        while (a[i] % p[j] == 0) t ^= 1, a[i] /= p[j];
        if (t) c[i] |= (1ULL << j - 1);
      }
  }
  int p = gauss(n, c);
  p = n - p;
  int t = 1;
  for (int i = 1; i <= p; i++) t = t * 2 % (1000000007);
  t = sub(t, 1);
  cout << t << endl;
  return 0;
}
