#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 75;
const int MAX_NN = 1e5 + 5;
const int MAX_P = 20;
const int MODVAL = 1e9 + 7;
int N, cnt[MAX_N], prfac[MAX_N];
long long pow2[MAX_NN], dp[MAX_N][1 << MAX_P];
void pre() {
int prcnt = 0;
for(int i=2; i<MAX_N; i++) {
int prime = 1;
for(int j=2; j*j<=i; j++) if(i%j == 0) {
prime = 0;
break;
}
if(!prime) continue;
for(int j=i; j<MAX_N; j+=i) {
int k = j, c = 0;
while(k%i == 0) k /= i, c++;
if(c&1) prfac[j] |= 1 << prcnt;
}
prcnt++;
}
pow2[0] = 1;
for(int i=1; i<MAX_NN; i++)
pow2[i] = (pow2[i-1] << 1) % MODVAL;
memset(dp, -1, sizeof dp);
}
long long recur(int i, int mask) {
if(i == 0)
return mask == 0 ? 1 : 0;
if(dp[i][mask] == -1) {
if(cnt[i] == 0)
dp[i][mask] = recur(i-1, mask);
else
dp[i][mask] = (recur(i-1, mask) + recur(i-1, mask ^ prfac[i])) * pow2[cnt[i]-1] % MODVAL;
}
return dp[i][mask];
}
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
pre();
cin >> N;
for(int i=0; i<N; i++) {
int x;
cin >> x;
cnt[x]++;
}
cout << (recur(70, 0) + MODVAL - 1) % MODVAL << "\n";
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBpbnQgTUFYX04gPSA3NTsKY29uc3QgaW50IE1BWF9OTiA9IDFlNSArIDU7CmNvbnN0IGludCBNQVhfUCA9IDIwOwpjb25zdCBpbnQgTU9EVkFMID0gMWU5ICsgNzsKCmludCBOLCBjbnRbTUFYX05dLCBwcmZhY1tNQVhfTl07CmxvbmcgbG9uZyBwb3cyW01BWF9OTl0sIGRwW01BWF9OXVsxIDw8IE1BWF9QXTsKCnZvaWQgcHJlKCkgewogICAgaW50IHByY250ID0gMDsKICAgIGZvcihpbnQgaT0yOyBpPE1BWF9OOyBpKyspIHsKICAgICAgICBpbnQgcHJpbWUgPSAxOwogICAgICAgIGZvcihpbnQgaj0yOyBqKmo8PWk7IGorKykgaWYoaSVqID09IDApIHsKICAgICAgICAgICAgcHJpbWUgPSAwOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgaWYoIXByaW1lKSBjb250aW51ZTsKICAgICAgICAKICAgICAgICBmb3IoaW50IGo9aTsgajxNQVhfTjsgais9aSkgewogICAgICAgICAgICBpbnQgayA9IGosIGMgPSAwOwogICAgICAgICAgICB3aGlsZShrJWkgPT0gMCkgayAvPSBpLCBjKys7CiAgICAgICAgICAgIGlmKGMmMSkgcHJmYWNbal0gfD0gMSA8PCBwcmNudDsKICAgICAgICB9CiAgICAgICAgcHJjbnQrKzsKICAgIH0KICAgIHBvdzJbMF0gPSAxOwogICAgZm9yKGludCBpPTE7IGk8TUFYX05OOyBpKyspCiAgICAgICAgcG93MltpXSA9IChwb3cyW2ktMV0gPDwgMSkgJSBNT0RWQUw7CiAgICBtZW1zZXQoZHAsIC0xLCBzaXplb2YgZHApOwp9Cgpsb25nIGxvbmcgcmVjdXIoaW50IGksIGludCBtYXNrKSB7CiAgICBpZihpID09IDApCiAgICAgICAgcmV0dXJuIG1hc2sgPT0gMCA/IDEgOiAwOwogICAgCiAgICBpZihkcFtpXVttYXNrXSA9PSAtMSkgewogICAgICAgIGlmKGNudFtpXSA9PSAwKQogICAgICAgICAgICBkcFtpXVttYXNrXSA9IHJlY3VyKGktMSwgbWFzayk7CiAgICAgICAgZWxzZQogICAgICAgICAgICBkcFtpXVttYXNrXSA9IChyZWN1cihpLTEsIG1hc2spICsgcmVjdXIoaS0xLCBtYXNrIF4gcHJmYWNbaV0pKSAqIHBvdzJbY250W2ldLTFdICUgTU9EVkFMOwogICAgfQogICAgcmV0dXJuIGRwW2ldW21hc2tdOwp9CgppbnQgbWFpbigpIHsKICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOyBjaW4udGllKE5VTEwpOwogICAgCiAgICBwcmUoKTsKICAgIGNpbiA+PiBOOwogICAgZm9yKGludCBpPTA7IGk8TjsgaSsrKSB7CiAgICAgICAgaW50IHg7CiAgICAgICAgY2luID4+IHg7CiAgICAgICAgY250W3hdKys7CiAgICB9CiAgICAKICAgIGNvdXQgPDwgKHJlY3VyKDcwLCAwKSArIE1PRFZBTCAtIDEpICUgTU9EVkFMIDw8ICJcbiI7CiAgICAKICAgIHJldHVybiAwOwp9