#include <bits/stdc++.h>
using namespace std;
const int64_t mod = 1e9 + 7;
int64_t Prime[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
                   31, 37, 41, 43, 47, 53, 59, 61, 67};
int64_t n, res = 0, Pre[70], ff[16][16];
vector<int64_t> V[20], f[16][2][16];
void Init() {
  Pre[1] = 0;
  int64_t Count = 0;
  for (int64_t i = 4; i <= 18; i++) Pre[Prime[i]] = ++Count;
}
int main() {
  ios_base::sync_with_stdio(false);
  Init();
  cin >> n;
  int64_t x;
  for (int64_t i = 1; i <= n; i++) {
    cin >> x;
    int64_t sum = 0;
    for (int64_t j = 0; j <= 3; j++) {
      int64_t Count = 0;
      while (x % Prime[j] == 0) {
        Count ^= 1;
        x /= Prime[j];
      }
      sum += Count * (1 << j);
    }
    V[Pre[x]].push_back(sum);
  }
  for (int64_t pos = 0; pos <= 15; pos++)
    for (int64_t j = 0; j <= 15; j++) {
      f[pos][0][j].resize(V[pos].size() + 5);
      f[pos][1][j].resize(V[pos].size() + 5);
    }
  if (V[0].size() > 0) {
    f[0][0][0][0]++;
    f[0][0][V[0][0]][0]++;
    for (int64_t i = 1; i < V[0].size(); i++)
      for (int64_t j = 0; j <= 15; j++)
        f[0][0][j][i] = (f[0][0][j][i - 1] + f[0][0][j ^ V[0][i]][i - 1]) % mod;
  }
  for (int64_t pos = 1; pos <= 15; pos++)
    if (V[pos].size() > 0) {
      f[pos][0][0][0]++;
      f[pos][1][V[pos][0]][0]++;
      for (int64_t i = 1; i < V[pos].size(); i++)
        for (int64_t j = 0; j <= 15; j++) {
          f[pos][0][j][i] =
              (f[pos][0][j][i - 1] + f[pos][1][j ^ V[pos][i]][i - 1]) % mod;
          f[pos][1][j][i] =
              (f[pos][1][j][i - 1] + f[pos][0][j ^ V[pos][i]][i - 1]) % mod;
        }
    }
  if (V[0].size() > 0)
    for (int64_t i = 0; i <= 15; i++) ff[0][i] = f[0][0][i][V[0].size() - 1];
  else
    ff[0][0] = 1;
  for (int64_t pos = 1; pos <= 15; pos++)
    for (int64_t i = 0; i <= 15; i++) {
      if (V[pos].size() > 0)
        for (int64_t t = 0; t <= 15; t++)
          ff[pos][i] = (ff[pos][i] +
                        ff[pos - 1][t] * f[pos][0][i ^ t][V[pos].size() - 1]) %
                       mod;
      else
        ff[pos][i] = ff[pos - 1][i];
    }
  cout << (ff[15][0] - 1 + mod) % mod;
}
