#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
int n, a[77];
int mask[10000], dp[10000];
int v[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
           31, 37, 41, 43, 47, 53, 59, 61, 67};
int bin(int a, int b) {
  if (!b) return 1;
  if (b & 1) return 1ll * a * bin(a, b - 1) % 1000000007;
  int q = bin(a, b >> 1);
  return 1ll * q * q % 1000000007;
}
int main() {
  scanf("%d", &n);
  int cnt = 0;
  for (int i = 0, t; i < n; i++) {
    scanf("%d", &t);
    for (int j = 2; j < 9; j++)
      while (t % (j * j) == 0) t /= j * j;
    if (t > 1)
      a[t]++;
    else
      cnt++;
  }
  int ans = bin(2, cnt);
  for (int i = 11; i <= 18; i++)
    if (a[v[i]]) {
      ans = 1ll * ans * bin(2, a[v[i]] - 1) % 1000000007;
      a[v[i]] = 0;
    }
  dp[0] = 1;
  for (int i = 2; i < 71; ++i) {
    if (!a[i]) continue;
    int x = 0;
    for (int j = 0; j <= 10; j++)
      if (i % v[j] == 0) x ^= (1 << j);
    int t = bin(2, a[i] - 1);
    for (int j = 0; j < (1 << 11); j++) mask[j] = 1ll * dp[j] * t % 1000000007;
    for (int j = 0; j < (1 << 11); j++)
      mask[x ^ j] = (mask[x ^ j] + 1ll * dp[j] * t) % 1000000007;
    for (int j = 0; j < (1 << 11); j++) dp[j] = mask[j];
  }
  cout << (1ll * ans * dp[0] - 1 + 1000000007) % 1000000007;
}
