#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-9;
const int MX = 1e5 + 9;
const int MaxValue = 70;
const long long inf = LLONG_MAX;
string ToBinary(int x) {
  string st = "";
  while (x) {
    st += '0' + (x % 2);
    x /= 2;
  }
  while (st.size() <= 32) st += '0';
  reverse(st.begin(), st.end());
  return st;
}
int lp[MaxValue + 9], freq[1 << 20], ToMask[MaxValue], idx[MaxValue + 9],
    vis[1 << 20], dp[2][1 << 20], Cum[MX];
int Meh(int x) {
  int mask = 0;
  while (lp[x] != x) {
    mask ^= (1 << idx[lp[x]]);
    x /= lp[x];
  }
  if (x != 1) mask ^= (1 << idx[x]);
  return mask;
}
void Initialize() {
  for (int i = 1; i <= MaxValue; i++) lp[i] = i;
  for (int i = 2; i * i <= MaxValue; i++)
    if (lp[i] == i)
      for (int j = i * i; j <= MaxValue; j += i)
        if (lp[j] == j) lp[j] = i;
  int j = 0;
  for (int i = 2; i <= MaxValue; i++)
    if (lp[i] == i) idx[i] = j++;
  for (int i = 1; i <= MaxValue; i++) ToMask[i] = Meh(i);
  return;
}
int bp(int a, int b) {
  if (b == 0ll) return 1ll;
  int tmp = bp(a, b / 2);
  if (b & 1) return (((1ll * tmp * tmp) % 1000000007) * a) % 1000000007;
  return (1ll * tmp * tmp) % 1000000007;
}
int WaysToPick(int x, int parity) {
  if (freq[ToMask[x]]) {
    return Cum[freq[ToMask[x]] - 1];
  }
  return parity ^ 1;
}
void test_case() {
  Initialize();
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    freq[ToMask[x]]++;
  }
  Cum[0] = 1;
  for (int i = 1; i <= n; i++) Cum[i] = (1ll * 2 * Cum[i - 1]) % 1000000007;
  dp[0][0] = 1;
  for (int x = 1; x <= MaxValue; x++) {
    if (vis[ToMask[x]]++) {
      for (int mask = 0; mask <= (1 << 19); mask++)
        dp[x & 1][mask] = dp[(x - 1) & 1][mask];
      continue;
    }
    for (int mask = 0; mask <= (1 << 19); mask++) {
      dp[x & 1][mask] =
          (1ll * dp[(x - 1) & 1][mask] * WaysToPick(x, 0)) % 1000000007 +
          (1ll * dp[(x - 1) & 1][mask ^ ToMask[x]] * WaysToPick(x, 1)) %
              1000000007;
      dp[x & 1][mask] %= 1000000007;
    }
  }
  printf("%d\n", dp[MaxValue & 1][0] - 1);
  return;
}
int main() {
  int T = 1;
  while (T--) test_case();
  return 0;
}
