#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int cnt_p, dp[71][(1 << 19) + 10], pow_2[100010], prime[21], sta[71], vis[71],
    num[71];
void init() {
  for (int i = 2; i <= 70; i++) {
    if (!vis[i]) {
      prime[cnt_p++] = i;
      for (int j = i + i; j <= 70; j += i) {
        vis[j] = 1;
      }
    }
  }
  pow_2[0] = 1;
  for (int i = 1; i <= 100000; i++) {
    pow_2[i] = pow_2[i - 1] * 2 % mod;
  }
  for (int i = 1; i <= 70; i++) {
    int k = i;
    for (int j = 0; j < cnt_p && prime[j] <= k; j++) {
      while (k % prime[j] == 0) {
        k /= prime[j];
        sta[i] ^= (1 << j);
      }
    }
  }
}
int main() {
  init();
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    num[x]++;
  }
  dp[0][0] = 1;
  int tot = (1 << 19) - 1;
  for (int i = 1; i <= 70; i++) {
    if (!num[i]) {
      for (int j = 0; j <= tot; j++) {
        dp[i][j] = (dp[i][j] + dp[i - 1][j]) % mod;
      }
    } else {
      for (int j = 0; j <= tot; j++) {
        dp[i][j ^ sta[i]] = (dp[i][j ^ sta[i]] + (long long)dp[i - 1][j] *
                                                     pow_2[num[i] - 1] % mod) %
                            mod;
        dp[i][j] =
            (dp[i][j] + (long long)dp[i - 1][j] * pow_2[num[i] - 1] % mod) %
            mod;
      }
    }
  }
  printf("%d\n", (dp[70][0] - 1 + mod) % mod);
  return 0;
}
