#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
int e = 1 << 20;
long long var[2][71];
long long dp[2][1 << 20];
int simp[19] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
                31, 37, 41, 43, 47, 53, 59, 61, 67};
int get_mask(int n) {
  int ans = 0;
  for (int i = 0; i < 19; i++) {
    int k = 0;
    while (n % simp[i] == 0) {
      k++;
      n /= simp[i];
    }
    if (k % 2 != 0) ans += 1 << i;
  }
  return ans;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i <= 70; i++) {
    var[0][i] = 1;
  }
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    var[0][x] = var[1][x] = (var[0][x] + var[1][x]) % mod;
  }
  dp[0][0] = 1;
  for (int i = 0; i < 70; i++) {
    int mask = get_mask(i + 1);
    int f = i % 2, s = f ^ 1;
    for (int j = 0; j < e; j++) {
      dp[s][j] += (dp[f][j] * var[0][i + 1]);
      dp[s][j ^ mask] += (dp[f][j] * var[1][i + 1]);
      if (dp[s][j] >= mod) dp[s][j] %= mod;
      if (dp[s][j ^ mask] >= mod) dp[s][j ^ mask] %= mod;
    }
    for (int j = 0; j < e; j++) {
      dp[f][j] = 0;
    }
  }
  cout << dp[0][0] - 1;
  return 0;
}
