#include <bits/stdc++.h>
using namespace std;
int np2[100005], cnt[71] = {0}, prest[71];
int dp[2][1 << 11] = {0}, even[71], odd[71];
int pris[11] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
int large_p[] = {37, 41, 43, 47, 53, 59, 61, 67};
static inline int n2prim(int k) {
  int ret = 0, i, c;
  for (i = 0; i < 11; i++) {
    for (c = 0; k % pris[i] == 0; c++) {
      k /= pris[i];
    }
    if (c % 2 == 1) ret |= (1 << i);
  }
  return ret;
}
int main() {
  int i, n, j;
  long long t, r = 1;
  scanf("%d", &n);
  for (np2[0] = 1, i = 0; i < n; i++) {
    scanf("%d", &j);
    cnt[j]++;
    np2[i + 1] = (np2[i] * 2) % 1000000007;
  }
  for (i = 0; i < 71; i++) {
    if (cnt[i] == 0) {
      even[i] = 1;
      odd[i] = 0;
    } else {
      even[i] = odd[i] = np2[cnt[i] - 1];
    }
  }
  for (i = 0; i < sizeof(large_p) / sizeof(int); i++) {
    r = (r * even[large_p[i]]) % 1000000007;
    even[large_p[i]] = 1;
    odd[large_p[i]] = 0;
  }
  for (i = 1; i < 71; i++) prest[i] = n2prim(i);
  dp[(71 - 1) % 2][0] = even[71 - 1];
  dp[(71 - 1) % 2][prest[71 - 1]] = odd[71 - 1];
  for (i = 71 - 2; i > 0; i--) {
    for (j = 0; j < (1 << 11); j++) {
      t = even[i];
      dp[i % 2][j] = (t * dp[(i + 1) % 2][j]) % 1000000007;
      t = odd[i];
      t = (t * dp[(i + 1) % 2][j ^ prest[i]]) % 1000000007;
      dp[i % 2][j] = (dp[i % 2][j] + t) % 1000000007;
    }
  }
  r = ((r * dp[1][0]) % 1000000007) - 1;
  printf("%lld\n", r);
  return 0;
}
