# [高斯消元 矩阵的秩] 51Nod 1356 代数数的次数

#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<cassert>
using namespace std;
typedef long long ll;

const int maxn=200005;
const int P=1e9+7;

int vst[maxn];
int prime[maxn],num;

inline void Pre(int n){
for (int i=2;i<=n;i++){
if (!vst[i]) prime[++num]=i;
for (int j=1;j<=num && (ll)i*prime[j]<=n;j++){
vst[i*prime[j]]=1;
if (i%prime[j]==0) break;
}
}
}

const int N=505;

bitset<N> B[20005];

int n,a[N];

int sx[20000],icnt;

inline int Bin(int x){
return lower_bound(sx+1,sx+icnt+1,x)-sx;
}

int main(){
freopen("t.in","r",stdin);
freopen("t.out","w",stdout);
Pre(2e5);
for (int i=1;i<=n;i++){
for (int j=1;j<=num && (ll)prime[j]*prime[j]<=a[i];j++)
if (t%prime[j]==0){
sx[++icnt]=prime[j];
while (t%prime[j]==0) t/=prime[j];
}
if (t>1) sx[++icnt]=t;
}
sort(sx+1,sx+icnt+1); icnt=unique(sx+1,sx+icnt+1)-sx-1;
for (int i=1;i<=n;i++){
int t=a[i];
for (int j=1;j<=num && (ll)prime[j]*prime[j]<=a[i];j++)
if (t%prime[j]==0){
int it=Bin(prime[j]); int c=0;
while (t%prime[j]==0)
c^=1,t/=prime[j];
B[it][i]=c;
}
if (t>1){
B[Bin(t)][i]=1;
}
}
ll ans=1; int k=0;
for (int i=1;i<=n;i++){
int t=0;
for (int j=k+1;j<=icnt;j++) if (B[j][i]) t=j;
if (t){
swap(B[++k],B[t]);
(ans<<=1)%=P;
for (int j=k+1;j<=icnt;j++)
if (B[j][i])
B[j]^=B[k];
}
}
assert(k<=n);
printf("%d\n",ans);
return 0;
}