#include <bits/stdc++.h>
using namespace std;
int pre[71];
void seive() {
  int fact[71];
  int prm[71];
  for (int i = 1; i <= 70; i++) fact[i] = i;
  int j = 0;
  for (int i = 2; i <= 70; i++) {
    if (fact[i] == i) {
      prm[i] = j++;
      for (int j = 2 * i; j <= 70; j += i)
        if (fact[j] == j) fact[j] = i;
    }
  }
  pre[1] = 0;
  for (int i = 2; i <= 70; i++) {
    int nu = i;
    int pr = 0;
    while (nu > 1) {
      int x = fact[nu];
      int cc = 0;
      while (nu % x == 0) {
        nu /= x;
        cc++;
      }
      if (cc % 2) pr += 1 << prm[x];
    }
    pre[i] = pr;
  }
}
long long power(long long y) {
  long long res = 1;
  long long x = 2, p = 1000000007;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long DP[2][(1 << 19) + 1];
int cnt[(1 << 19) + 1];
vector<int> b;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  seive();
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    x = pre[x];
    if (++cnt[x] == 1) b.push_back(x);
  }
  DP[0][0] = 1;
  for (int i = 1; i < (1 << 19); i++) DP[0][i] = 0;
  for (int i = 0; i < b.size(); i++) {
    for (int j = 0; j < (1 << 19); j++) {
      DP[1][j] =
          (power(cnt[b[i]] - 1) * (DP[0][j] + DP[0][j ^ b[i]])) % 1000000007;
    }
    for (int j = 0; j < (1 << 19); j++) DP[0][j] = DP[1][j];
  }
  cout << (DP[1][0] - 1 + 1000000007) % 1000000007 << endl;
  return 0;
}
