#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 26;
const long long mod = (long long)1e9 + 7;
const int prime[20] = {0,  2,  3,  5,  7,  11, 13, 17, 19, 23,
                       29, 31, 37, 41, 43, 47, 53, 59, 61, 67};
int n;
int a[100005];
int s[75];
int cnt[1005];
int dp[75][(1 << 19) + 5], p2[100005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= 70; i++) {
    int tmp = i;
    for (int j = 1; j <= 19; j++) {
      while (tmp % prime[j] == 0) {
        s[i] ^= (1 << (j - 1));
        tmp /= prime[j];
      }
    }
  }
  p2[0] = 1;
  for (int i = 1; i <= n; i++) p2[i] = (p2[i - 1] * 2) % mod;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), ++cnt[a[i]];
  dp[0][0] = 1;
  for (int i = 1; i <= 70; i++) {
    if (cnt[i]) {
      for (int j = 0; j < (1 << 19); j++) {
        dp[i][j ^ s[i]] =
            ((long long)dp[i][j ^ s[i]] +
             ((long long)p2[cnt[i] - 1] * (long long)dp[i - 1][j])) %
            mod;
        dp[i][j] =
            ((long long)dp[i][j] + (long long)p2[cnt[i] - 1] * dp[i - 1][j]) %
            mod;
      }
    } else {
      for (int j = 0; j < (1 << 19); j++) dp[i][j] = dp[i - 1][j];
    }
  }
  printf("%d\n", (dp[70][0] - 1 + mod) % mod);
  return 0;
}
