#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
const int N = (int)1e5 + 5;
const int INF = 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
int a[N];
long long fact[N];
long long f[2][N];
int cnt[100];
vector<int> pr = {};
int id[100], mask[100];
int dp[71][(1 << 19)];
long long add(long long a, long long b) {
  return ((a % MOD) + (b % MOD)) % MOD;
}
long long mult(long long a, long long b) {
  return ((a % MOD) * (b % MOD)) % MOD;
}
long long pw(int a, int b) {
  if (b == 0) {
    return 1;
  }
  if (b % 2 == 0) {
    long long x = pw(a, b / 2);
    return mult(x, x);
  } else {
    return mult(a, pw(a, b - 1));
  }
}
long long divide(long long a, long long b) { return mult(a, pw(b, MOD - 2)); }
long long nk(long long n, long long k) {
  if (k > n) {
    return 0;
  }
  return divide(fact[n], mult(fact[k], fact[n - k]));
}
void precalc() {
  fact[0] = 1;
  for (int i = 1; i <= 1e5; i++) {
    fact[i] = mult(fact[i - 1], i);
  }
  for (int i = 2; i <= 70; i++) {
    bool ok = 1;
    for (int j = 2; j * j <= i; j++) {
      if (i % j == 0) {
        ok = false;
        break;
      }
    }
    if (ok) {
      pr.push_back(i);
    }
  }
  memset(id, -1, sizeof id);
  for (int i = 0; i < 19; i++) {
    id[pr[i]] = i;
  }
  for (int x = 1; x <= 70; x++) {
    int X = x;
    for (int i = 2; i * i <= X; i++) {
      if (X % i == 0) {
        while (X % i == 0) {
          mask[x] ^= (1 << id[i]);
          X /= i;
        }
      }
    }
    if (X > 1) {
      mask[x] ^= (1 << id[X]);
    }
  }
}
string get(int x) {
  string s = "";
  while (x > 0) {
    char c = (x % 2) + '0';
    s += c;
    x /= 2;
  }
  while (s.size() <= 19) {
    s += '0';
  }
  return s;
}
int main() {
  precalc();
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    cnt[a[i]]++;
  }
  for (int x = 1; x <= 70; x++) {
    for (int i = 0; i <= cnt[x]; i += 2) {
      f[0][x] = add(f[0][x], nk(cnt[x], i));
    }
    for (int i = 1; i <= cnt[x]; i += 2) {
      f[1][x] = add(f[1][x], nk(cnt[x], i));
    }
  }
  dp[0][0] = 1;
  for (int i = 0; i < 70; i++) {
    for (int j = 0; j < (1 << 19); j++) {
      dp[i + 1][(j ^ mask[i + 1])] =
          add(dp[i + 1][(j ^ mask[i + 1])], mult(f[1][i + 1], dp[i][j]));
      dp[i + 1][j] = add(dp[i + 1][j], mult(f[0][i + 1], dp[i][j]));
    }
  }
  cout << dp[70][0] - 1;
}
