#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using i64 = long long;
inline void faster_ll_div_mod(u64 x, u32 y, u32 &out_d, u32 &out_m) {
  u32 xh = (u32)(x >> 32), xl = (u32)x, d, m;
  asm("divl %4; \n\t" : "=a"(d), "=d"(m) : "d"(xh), "a"(xl), "r"(y));
  out_d = d;
  out_m = m;
}
template <int MOD>
struct mod_int {
  u32 x;
  mod_int() : x(0) {}
  mod_int(int sig) {
    int sigt = sig % MOD;
    if (sigt < 0) sigt += MOD;
    x = sigt;
  }
  mod_int(i64 sig) {
    int sigt = sig % MOD;
    if (sigt < 0) sigt += MOD;
    x = sigt;
  }
  int get() const { return (int)x; }
  mod_int &operator+=(mod_int that) {
    if ((x += that.x) >= MOD) x -= MOD;
    return *this;
  }
  mod_int &operator-=(mod_int that) {
    if ((x += MOD - that.x) >= MOD) x -= MOD;
    return *this;
  }
  mod_int &operator*=(mod_int that) {
    u32 dummy;
    faster_ll_div_mod((u64)x * that.x, MOD, dummy, x);
    return *this;
  }
  mod_int operator*(mod_int that) const {
    mod_int res;
    u32 dummy;
    faster_ll_div_mod((u64)x * that.x, MOD, dummy, res.x);
    return res;
  }
  mod_int operator+(mod_int that) const { return mod_int(*this) += that; }
  mod_int operator-(mod_int that) const { return mod_int(*this) -= that; }
};
using mint = mod_int<1000000007>;
using vm = vector<mint>;
using vvm = vector<vm>;
int main() {
  int n;
  cin >> n;
  vi primes = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
               31, 37, 41, 43, 47, 53, 59, 61, 67};
  vi masks(71);
  for (int i = 1; i < 71; ++i) {
    int k = i;
    for (int j = 0; j < primes.size(); ++j) {
      while (k % primes[j] == 0) {
        k /= primes[j];
        masks[i] ^= 1 << j;
      }
    }
  }
  vm takeEven(71, 1);
  vm takeOdd(71);
  while (n--) {
    int i;
    cin >> i;
    takeEven[i] = takeOdd[i] = takeEven[i] + takeOdd[i];
  }
  vvm dp(2, vm(1 << 19));
  dp[0][0] = 1;
  for (int i = 0; i <= 70; ++i) {
    int cur = i & 1;
    int nxt = cur ^ 1;
    for (int msk = 0; msk < (1 << 19); ++msk) {
      dp[nxt][msk] += dp[cur][msk] * takeEven[i];
      dp[nxt][msk ^ masks[i]] += dp[cur][msk] * takeOdd[i];
      dp[cur][msk] = 0;
    }
  }
  cout << (dp[1][0] - 1).get() << endl;
  return 0;
}
