#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e5 + 15;
const int mod = (int)1e9 + 7;
int primes[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
                31, 37, 41, 43, 47, 53, 59, 61, 67};
int counter[80], dp[2][(1 << 19)];
vector<int> v;
long long pow2[maxn];
int getXor(int k) {
  dp[0][0] = 1;
  for (int i = 1; i <= (int)v.size(); i++) {
    for (int j = 0; j < (1 << 19); j++) {
      dp[i & 1][j] = (dp[(i - 1) & 1][j] + dp[(i - 1) & 1][j ^ v[i - 1]]) % mod;
    }
  }
  return dp[(int)v.size() & 1][k];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  pow2[0] = 1ll;
  for (int i = 0, x; i < n; i++) {
    cin >> x;
    counter[x]++;
    pow2[i + 1] = (pow2[i] * 2ll) % mod;
  }
  for (int val = 0; val < 80; val++) {
    if (!counter[val]) continue;
    counter[val]--;
    int add = 0, x = val;
    for (int j = 0; j < 19; j++) {
      bool check = false;
      while (x % primes[j] == 0) {
        x /= primes[j];
        check ^= 1;
      }
      if (check) {
        add |= (1 << j);
      }
      if (x == 1) {
        break;
      }
    }
    v.push_back(add);
  }
  long long res = getXor(0);
  for (int i = 0; i < 80; i++) {
    res = (res * pow2[counter[i]]) % mod;
  }
  cout << (res + mod - 1) % mod << '\n';
  return 0;
}
