#include <bits/stdc++.h>
using namespace std;
int dd[75];
vector<int> snt;
int n;
long long MOD = 1e9 + 7;
long long Nhan(long long x, long long y) { return (1ll * x * y) % MOD; }
void Cong(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
long long Mu(int c, int m) {
  if (m == 0) return 1;
  if (m == 1) return 1ll * c;
  long long mid = Mu(c, m / 2);
  if (m % 2 == 0)
    return Nhan(mid, mid);
  else
    return Nhan(mid, Nhan(mid, c));
}
class Gaussian {
 public:
  int start[100005];
  int basis[20];
  int hople;
  void FindBasis();
  long long COUNT();
};
void Gaussian::FindBasis() {
  for (int i = 18, cur = 1; cur <= n && i >= 0; i--) {
    if (!((start[cur] >> i) & 1)) {
      for (int j = cur + 1; j <= n; j++) {
        if ((start[j] >> i) & 1) {
          swap(start[j], start[cur]);
          break;
        }
      }
    }
    if (!((start[cur] >> i) & 1)) {
      continue;
    }
    for (int j = cur + 1; j <= n; j++) {
      if ((start[j] >> i) & 1) {
        start[j] ^= start[cur];
      }
    }
    basis[i] = start[cur];
    cur++;
  }
}
long long Gaussian::COUNT() {
  long long dapan = 0;
  sort(basis, basis + 18, greater<int>());
  for (int i = 0; i < (1 << 19); i++) {
    int cur = 0;
    for (int j = 18; j >= 0; j--) {
      if ((i >> j) & 1) {
        cur ^= basis[j];
      }
    }
    dapan = dapan + (cur == 0);
  }
  if (n < 19) dapan = dapan / Mu(2, 19 - n);
  if (n > 19) dapan = Nhan(dapan, Mu(2, n - 19));
  --dapan;
  if (dapan < 0) dapan += MOD;
  return dapan;
}
int main() {
  for (int i = 2; i <= 70; i++) {
    if (!dd[i]) {
      snt.push_back(i);
      for (int j = i + i; j <= 70; j += i) dd[j] = 1;
    }
  }
  cin >> n;
  Gaussian a;
  a.hople = 19;
  memset(a.basis, 0, sizeof(a.basis));
  memset(a.start, 0, sizeof(a.start));
  int one = 0;
  for (int i = 1; i <= n; i++) {
    int u;
    cin >> u;
    int cur = 0;
    for (int j = 0; j < snt.size(); j++) {
      int dem = 0;
      while (u % snt[j] == 0) {
        u /= snt[j];
        ++dem;
      }
      if (dem % 2 == 1) cur = cur + (1 << j);
    }
    a.start[i] = cur;
  }
  a.FindBasis();
  cout << a.COUNT();
}
