#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
long long __gcd(long long a, long long b) {
  while (a != 0) {
    long long __t = b % a;
    b = a;
    a = __t;
  }
  return b;
}
bool isPrime(int x) {
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
const long long MOD = 1e9 + 7;
int main() {
  cin.tie(0);
  cout.tie(0);
  cerr.tie(0);
  ios_base::sync_with_stdio(false);
  vector<vector<long long> > f(2, vector<long long>(71));
  vector<long long> mask(71);
  {
    vector<unsigned> primes;
    for (unsigned i = 2; i <= 70; i++)
      if (isPrime(i)) primes.push_back(i);
    for (unsigned i = 0; i <= 70; i++) f[0][i] = 1;
    for (unsigned i = 0; i < primes.size(); i++) {
      unsigned p = primes[i];
      for (unsigned j = 1; j <= 70; j++) {
        unsigned x = j;
        while (x % p == 0) {
          x /= p;
          mask[j] ^= (1 << i);
        }
      }
    }
  }
  unsigned N;
  cin >> N;
  for (unsigned i = 0; i < N; i++) {
    unsigned x;
    cin >> x;
    f[0][x] = f[1][x] = (f[0][x] + f[1][x]) % MOD;
  }
  vector<vector<long long> > d(2, vector<long long>(1 << 20));
  d[0][0] = 1;
  for (unsigned i = 0; i <= 70; i++) {
    bool nxt = (i + 1) & 1;
    bool cur = i & 1;
    for (long long cmask = 0; cmask < (1 << 20); cmask++) {
      d[nxt][cmask ^ mask[i]] =
          d[nxt][cmask ^ mask[i]] + d[cur][cmask] * f[1][i];
      d[nxt][cmask] = d[nxt][cmask] + d[cur][cmask] * f[0][i];
      if (d[nxt][cmask ^ mask[i]] >= MOD) d[nxt][cmask ^ mask[i]] %= MOD;
      if (d[nxt][cmask] >= MOD) d[nxt][cmask] %= MOD;
    }
    fill(d[cur].begin(), d[cur].end(), 0);
  }
  cout << (d[1][0] - 1 + 2 * MOD) % MOD;
  return 0;
}
