#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 10;
const int MOD = 1e9 + 7;
const int p1[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
const int p2[] = {37, 41, 43, 47, 53, 59, 61, 67};
int dp[2][1 << 11];
int ans = 0;
int a[MAX_N], N;
int g1[MAX_N], g2[MAX_N];
int main() {
  for (int val = 1; val <= 70; val++) {
    int nval = val;
    for (int i = 0; i < 11; i++) {
      if (val % p1[i] != 0) continue;
      int flag = 0;
      while (nval % p1[i] == 0) {
        nval /= p1[i];
        flag ^= 1;
      }
      if (flag) g1[val] |= 1 << i;
    }
    for (int i = 0; i < 8; i++)
      if (val == p2[i]) g2[val] |= 1 << i;
  }
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%d", &a[i]);
  dp[0][0] = 1;
  for (int i = 0; i < N; i++) {
    int now = i & 1, nxt = now ^ 1;
    if (g2[a[i]] > 0) {
      for (int mask = 0; mask < (1 << 11); mask++)
        dp[nxt][mask] = dp[now][mask];
    } else {
      for (int mask = 0; mask < (1 << 11); mask++) dp[nxt][mask] = 0;
      for (int mask = 0; mask < (1 << 11); mask++)
        if (dp[now][mask]) {
          dp[nxt][mask ^ g1[a[i]]] =
              (dp[nxt][mask ^ g1[a[i]]] + dp[now][mask]) % MOD;
          dp[nxt][mask] = (dp[nxt][mask] + dp[now][mask]) % MOD;
        }
    }
  }
  ans = dp[N & 1][0];
  for (int i = 0; i < 2; i++)
    for (int mask = 0; mask < (1 << 11); mask++) dp[i][mask] = 0;
  dp[0][0] = 1;
  for (int i = 0; i < N; i++) {
    int now = i & 1, nxt = now ^ 1;
    if (g2[a[i]] == 0) {
      for (int mask = 0; mask < (1 << 9); mask++) dp[nxt][mask] = dp[now][mask];
    } else {
      for (int mask = 0; mask < (1 << 9); mask++) dp[nxt][mask] = 0;
      for (int mask = 0; mask < (1 << 9); mask++)
        if (dp[now][mask]) {
          dp[nxt][mask ^ g2[a[i]]] =
              (dp[nxt][mask ^ g2[a[i]]] + dp[now][mask]) % MOD;
          dp[nxt][mask] = (dp[nxt][mask] + dp[now][mask]) % MOD;
        }
    }
  }
  ans = 1ll * ans * dp[N & 1][0] % MOD;
  ans = (ans - 1 + MOD) % MOD;
  printf("%d\n", ans);
  return 0;
}
