#include <bits/stdc++.h>
using namespace std;
//#define _FILES
#define PII pair<int,int>
#define PB push_back
#define SZ size()
#define LEN length()
#define LL long long
const int MAXN = 1200005;
const int MD = 1e9+7;
bool isPrime[MAXN];
int dp[505][200];
vector<LL> pr;
int G(LL x)
{
int ans,cnt;
ans = 0;
for (int i=0;i<pr.size();i++)
{
if (pr[i]*pr[i]>x) break;
cnt = 0;
while (((x/pr[i])*pr[i])==x)
{
cnt++;
x/=pr[i];
}
ans+=cnt;
}
if (x>1) ans++;
return ans;
}
int main()
{
ios_base::sync_with_stdio(false);
#ifdef _FILES
freopen("","r",stdin);
freopen("","w",stdout);
#endif // _FILES
int n,g[505],ans;
LL x;
memset(isPrime,true,sizeof(isPrime));
for (int i=2;i<MAXN;i++)
{
if (!isPrime[i]) continue;
for (int j=2;j*i<MAXN;j++) isPrime[i*j] = false;
pr.PB(i);
}
cin>>n;
for (int i=1;i<=n;i++)
{
cin>>x;
g[i] = G(x);
}
memset(dp,0,sizeof(dp));
dp[0][0] = 1;
for (int i=1;i<=n;i++)
{
for (int j=0;j<200;j++)
{
dp[i][j] += dp[i-1][j];
if (dp[i][j]>=MD) dp[i][j] -= MD;
dp[i][j^g[i]] += dp[i-1][j];
if (dp[i][j^g[i]]>=MD) dp[i][j^g[i]] -= MD;
}
}
ans = 0;
for (int i=1;i<200;i++)
{
ans+=dp[n][i];
if (ans>=MD) ans-=MD;
}
cout<<ans<<endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKLy8jZGVmaW5lIF9GSUxFUwojZGVmaW5lIFBJSSBwYWlyPGludCxpbnQ+CiNkZWZpbmUgUEIgcHVzaF9iYWNrCiNkZWZpbmUgU1ogc2l6ZSgpCiNkZWZpbmUgTEVOIGxlbmd0aCgpCiNkZWZpbmUgTEwgbG9uZyBsb25nCmNvbnN0IGludCBNQVhOID0gMTIwMDAwNTsKY29uc3QgaW50IE1EID0gMWU5Kzc7CmJvb2wgaXNQcmltZVtNQVhOXTsKaW50IGRwWzUwNV1bMjAwXTsKdmVjdG9yPExMPiBwcjsKaW50IEcoTEwgeCkKewogICAgaW50IGFucyxjbnQ7CiAgICBhbnMgPSAwOwogICAgZm9yIChpbnQgaT0wO2k8cHIuc2l6ZSgpO2krKykKICAgIHsKICAgICAgICBpZiAocHJbaV0qcHJbaV0+eCkgYnJlYWs7CiAgICAgICAgY250ID0gMDsKICAgICAgICB3aGlsZSAoKCh4L3ByW2ldKSpwcltpXSk9PXgpCiAgICAgICAgewogICAgICAgICAgICBjbnQrKzsKICAgICAgICAgICAgeC89cHJbaV07CiAgICAgICAgfQogICAgICAgIGFucys9Y250OwogICAgfQogICAgaWYgKHg+MSkgYW5zKys7CiAgICByZXR1cm4gYW5zOwp9CmludCBtYWluKCkKewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CgogICAgI2lmZGVmIF9GSUxFUwogICAgICAgIGZyZW9wZW4oIiIsInIiLHN0ZGluKTsKICAgICAgICBmcmVvcGVuKCIiLCJ3IixzdGRvdXQpOwogICAgI2VuZGlmIC8vIF9GSUxFUwogICAgaW50IG4sZ1s1MDVdLGFuczsKICAgIExMIHg7CiAgICBtZW1zZXQoaXNQcmltZSx0cnVlLHNpemVvZihpc1ByaW1lKSk7CiAgICBmb3IgKGludCBpPTI7aTxNQVhOO2krKykKICAgIHsKICAgICAgICBpZiAoIWlzUHJpbWVbaV0pIGNvbnRpbnVlOwogICAgICAgIGZvciAoaW50IGo9MjtqKmk8TUFYTjtqKyspIGlzUHJpbWVbaSpqXSA9IGZhbHNlOwogICAgICAgIHByLlBCKGkpOwogICAgfQogICAgY2luPj5uOwogICAgZm9yIChpbnQgaT0xO2k8PW47aSsrKQogICAgewogICAgICAgIGNpbj4+eDsKICAgICAgICBnW2ldID0gRyh4KTsKICAgIH0KICAgIG1lbXNldChkcCwwLHNpemVvZihkcCkpOwogICAgZHBbMF1bMF0gPSAxOwogICAgZm9yIChpbnQgaT0xO2k8PW47aSsrKQogICAgewogICAgICAgIGZvciAoaW50IGo9MDtqPDIwMDtqKyspCiAgICAgICAgewogICAgICAgICAgICBkcFtpXVtqXSArPSBkcFtpLTFdW2pdOwogICAgICAgICAgICBpZiAoZHBbaV1bal0+PU1EKSBkcFtpXVtqXSAtPSBNRDsKICAgICAgICAgICAgZHBbaV1bal5nW2ldXSArPSBkcFtpLTFdW2pdOwogICAgICAgICAgICBpZiAoZHBbaV1bal5nW2ldXT49TUQpIGRwW2ldW2peZ1tpXV0gLT0gTUQ7CiAgICAgICAgfQogICAgfQogICAgYW5zID0gMDsKICAgIGZvciAoaW50IGk9MTtpPDIwMDtpKyspCiAgICB7CiAgICAgICAgYW5zKz1kcFtuXVtpXTsKICAgICAgICBpZiAoYW5zPj1NRCkgYW5zLT1NRDsKICAgIH0KICAgIGNvdXQ8PGFuczw8ZW5kbDsKICAgIHJldHVybiAwOwp9