#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
int v1[11] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
int v2[8] = {37, 41, 43, 47, 53, 59, 61, 67};
int dp[2048], tdp[2048];
int cnt[15];
const int mod = 1e9 + 7;
int main() {
  int n, i, j;
  cin >> n;
  dp[0] = 1;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    for (j = 0; j < 8; j++) {
      if (t == v2[j]) break;
    }
    if (j < 8) {
      cnt[j]++;
      continue;
    }
    int t2 = 0;
    for (j = 0; j < 11; j++) {
      int c = 0;
      while (t % v1[j] == 0) {
        c++;
        t /= v1[j];
      }
      if (c % 2) t2 |= (1 << j);
    }
    for (int j = 0; j < 2048; j++) tdp[j] = (dp[j] + dp[j ^ t2]) % mod;
    for (int j = 0; j < 2048; j++) dp[j] = tdp[j];
  }
  long long ans = dp[0];
  for (int i = 0; i < 15; i++)
    for (int j = 1; j <= cnt[i] - 1; j++) ans = ans * 2 % mod;
  cout << (ans - 1) % mod << endl;
  return 0;
}
