#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define INF (1LL<<25)
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
//#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL<<61)
#define ull unsigned long long
#define debug1(x) cerr << #x << ": " << x <<'\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y <<'\n'
#define debug3(x, y, z) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z <<'\n'
using namespace std;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
int gcd(int x,int y)
{
    if(y==0)
        return x;
    else
        return gcd(y,x%y);
}
long long expo(int n,int m,int p)   //modULAR EXPONENTIATION
{
    long long r=1;
    n=n%p;
    while(m>0)
    {
        if(m%2)
            r=(r*n)%p;
        n=(n*n)%p;
        m=m/2;
    }
    return r%p;
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int n;
vector<int>a(71);
vector<int>f[76];
vector<int>isP(71);
int dp[71][(1<<19)+1];
int solve(int x,int y)
{
      if(x==71)
      {
            if(y==0)
            {
                  long long y=expo(2,a[1],mod);
                  return y;
            }
            return 0;
      }
      if(a[x]==0)
      {
            return solve(x+1,y);
      }
      if(dp[x][y]!=-1)
            return dp[x][y];
      long long l=1,ans=0,ty=y;
      for(int i=0;i<f[x].size();i++)
      {
            if(ty&(1LL<<isP[f[x][i]]))
            {
                  ty&=~(1LL << isP[f[x][i]]);
            }
            else
            {
                  ty=ty|(1LL<<isP[f[x][i]]);
            }
      }
      //    debug2(y,f[x][0]);
      long long o = expo(2,a[x]-1,mod);
      ans = ((o*solve(x+1,y))%mod + (o*solve(x+1,ty))%mod)%mod;
      dp[x][y]=ans;
      return ans;
      /*for(int i=0;i<=a[x];i++)
      {
            int g=(((fac[a[x]]*(expo(fac[i],mod-2,mod)))%mod)*(expo(fac[a[x]-i],mod-2,mod)))%mod;
            if(i==0)
            {
                  ans=(ans+solve(x+1,y))%mod;
            }
            else if(y==0)
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
            else
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
      }
      d[make_pair(x,y)]=ans;
      return ans;*/
}
int32_t main()
{
   IOS;
   #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
   #endif
   /********************* Code starts here ***********************/
   cin>>n;
   for(int i=0;i<71;i++)
   {
      for(int j=0;j<=(1LL<<19);j++)
      {
            dp[i][j]=-1;
      }
   }
   int p=0;
   for(int i=2;i<=70;i++)
   {
      if(isPrime(i))
      {
            isP[i]=p++;
      }
   }
   //cout<<p<<endl;
   for(int i=2;i<=70;i++)
   {
      int k=i;
      for(int j=2;j*j<=i;j++)
      {
            int c=0;
            while(k%j==0)
            {
                  c++;
                  k=k/j;
            }
            if(c%2==1)
            {
                  f[i].pb(j);
            }
            if(i%j==0)
            {
                  int u=i/j;
                  if(isPrime(u))
                  {
                        c=0;
                        k=i;
                        while(k%u==0)
                        {
                              c++;
                              k=k/u;
                        }
                        if(c%2==1)
                        {
                              f[i].pb(u);
                        }
                  }
            }
      }
   }
   for(int i=2;i<=70;i++)
   {
      if(f[i].size()==0 && isPrime(i))
            f[i].pb(i);
   }
   p=1;

   for(int i=0;i<n;i++)
   {
      int x;
      cin>>x;
      a[x]++;
   }
   long long int ans=(solve(2,0)-1+mod)%mod;
   cout<<ans<<endl;
}


#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define INF (1LL<<25)
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL<<61)
#define ull unsigned long long
#define debug1(x) cerr << #x << ": " << x <<'\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y <<'\n'
#define debug3(x, y, z) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z <<'\n'
using namespace std;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
int gcd(int x,int y)
{
    if(y==0)
        return x;
    else
        return gcd(y,x%y);
}
int expo(int n,int m,int p)   //modULAR EXPONENTIATION
{
    int r=1;
    n=n%p;
    while(m>0)
    {
        if(m%2)
            r=(r*n)%p;
        n=(n*n)%p;
        m=m/2;
    }
    return r%p;
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int n;
vector<int>a(71);
vector<int>f[76];
vector<int>fac(100005);
vector<int>isP(71);
int dp[71][1048577];
int solve(int x,int y)
{
      if(x==71)
      {
            if(y==0||y==1)
            {
                  int y=expo(2,a[1],mod);
                  return y;
            }
            return 0;
      }
      if(a[x]==0)
      {
            return solve(x+1,y);
      }
      if(dp[x][y]!=-1)
            return dp[x][y];
      int l=1,ans=0,ty=y;
      for(int i=0;i<f[x].size();i++)
      {
            if(ty&(1LL<<isP[f[x][i]]))
            {
                  ty&=~(1LL << isP[f[x][i]]);
            }
            else
            {
                  ty=ty|(1LL<<isP[f[x][i]]);
            }
      }
      for(int i=0;i<=a[x];i++)
      {
            int g=(((fac[a[x]]*(expo(fac[i],mod-2,mod)))%mod)*(expo(fac[a[x]-i],mod-2,mod)))%mod;
            if(i==0)
            {
                  ans=(ans+solve(x+1,y))%mod;
            }
            else if(y==0)
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
            else
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
      }
      dp[x][y]=ans;
      return ans;
}
int32_t main()
{
   IOS;
   #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
   #endif
   /********************* Code starts here ***********************/
   cin>>n;
   for(int i=0;i<=1048576;i++)
   {
      for(int j=0;j<=70;j++)
      {
            dp[j][i]=-1;
      }
   }
   int p=1;
   for(int i=2;i<=70;i++)
   {
      if(isPrime(i))
      {
            isP[i]=p++;
      }
   }
   for(int i=2;i<=70;i++)
   {
      int k=i;
      for(int j=2;j*j<=i;j++)
      {
            int c=0;
            while(k%j==0)
            {
                  c++;
                  k=k/j;
            }
            if(c%2==1)
            {
                  f[i].pb(j);
            }
            if(i%j==0)
            {
                  int u=i/j;
                  if(isPrime(u))
                  {
                        c=0;
                        k=i;
                        while(k%u==0)
                        {
                              c++;
                              k=k/u;
                        }
                        if(c%2==1)
                        {
                              f[i].pb(u);
                        }
                  }
            }
      }
   }
   for(int i=2;i<=70;i++)
   {
      if(f[i].size()==0)
            f[i].pb(i);
   }
   fac[0]=1;
   p=1;
   for(int i=1;i<=100000;i++)
   {
      p=(p*i)%mod;
      fac[i]=p;
   }
   for(int i=0;i<n;i++)
   {
      int x;
      cin>>x;
      a[x]++;
   }
   int ans=(solve(2,1)-1+mod)%mod;
   cout<<ans<<endl;
}


#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define INF (1LL<<25)
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL<<61)
#define ull unsigned long long
#define debug1(x) cerr << #x << ": " << x <<'\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y <<'\n'
#define debug3(x, y, z) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z <<'\n'
using namespace std;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
int gcd(int x,int y)
{
    if(y==0)
        return x;
    else
        return gcd(y,x%y);
}
int expo(int n,int m,int p)   //modULAR EXPONENTIATION
{
    int r=1;
    n=n%p;
    while(m>0)
    {
        if(m%2)
            r=(r*n)%p;
        n=(n*n)%p;
        m=m/2;
    }
    return r%p;
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int n;
vector<int>a(71);
vector<int>f[76];
vector<int>isP(71);
int dp[71][1<<19+1];
int solve(int x,int y)
{
      if(x==71)
      {
            if(y==0||y==1)
            {
                  int y=expo(2,a[1],mod);
                  return y;
            }
            return 0;
      }
      if(a[x]==0)
      {
            return solve(x+1,y);
      }
      if(dp[x][y]!=-1)
            return dp[x][y];
      int l=1,ans=0,ty=y;
      for(int i=0;i<f[x].size();i++)
      {
            if(ty&(1LL<<isP[f[x][i]]))
            {
                  ty&=~(1LL << isP[f[x][i]]);
            }
            else
            {
                  ty=ty|(1LL<<isP[f[x][i]]);
            }
      }
      ans=(ans+(expo(2,a[x]-1,mod)*(solve(x+1,y)+solve(x+1,ty)))%mod)%mod;
      dp[x][y]=ans;
      return ans;
      /*for(int i=0;i<=a[x];i++)
      {
            int g=(((fac[a[x]]*(expo(fac[i],mod-2,mod)))%mod)*(expo(fac[a[x]-i],mod-2,mod)))%mod;
            if(i==0)
            {
                  ans=(ans+solve(x+1,y))%mod;
            }
            else if(y==0)
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
            else
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
      }
      d[make_pair(x,y)]=ans;
      return ans;*/
}
int32_t main()
{
   IOS;
   #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
   #endif
   /********************* Code starts here ***********************/
   cin>>n;
   for(int i=0;i<71;i++)
   {
      for(int j=0;j<=(1LL<<19);j++)
      {
            dp[i][j]=-1;
      }
   }
   int p=1;
   for(int i=2;i<=70;i++)
   {
      if(isPrime(i))
      {
            isP[i]=p++;
      }
   }
   cout<<p<<endl;
   for(int i=2;i<=70;i++)
   {
      int k=i;
      for(int j=2;j*j<=i;j++)
      {
            int c=0;
            while(k%j==0)
            {
                  c++;
                  k=k/j;
            }
            if(c%2==1)
            {
                  f[i].pb(j);
            }
            if(i%j==0)
            {
                  int u=i/j;
                  if(isPrime(u))
                  {
                        c=0;
                        k=i;
                        while(k%u==0)
                        {
                              c++;
                              k=k/u;
                        }
                        if(c%2==1)
                        {
                              f[i].pb(u);
                        }
                  }
            }
      }
   }
   for(int i=2;i<=70;i++)
   {
      if(f[i].size()==0)
            f[i].pb(i);
   }
   fac[0]=1;
   p=1;
   for(int i=1;i<=100000;i++)
   {
      p=(p*i)%mod;
      fac[i]=p;
   }
   for(int i=0;i<n;i++)
   {
      int x;
      cin>>x;
      a[x]++;
   }
   int ans=(solve(2,1)-1+mod)%mod;
   cout<<ans<<endl;
}


#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define INF (1LL<<25)
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
//#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL<<61)
#define ull unsigned long long
#define debug1(x) cerr << #x << ": " << x <<'\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y <<'\n'
#define debug3(x, y, z) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z <<'\n'
using namespace std;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
int gcd(int x,int y)
{
    if(y==0)
        return x;
    else
        return gcd(y,x%y);
}
int expo(int n,int m,int p)   //modULAR EXPONENTIATION
{
    int r=1;
    n=n%p;
    while(m>0)
    {
        if(m%2)
            r=(r*n)%p;
        n=(n*n)%p;
        m=m/2;
    }
    return r%p;
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int n;
vector<int>a(71);
vector<int>f[76];
vector<int>isP(71);
int dp[71][(1<<19)+1];
int solve(int x,int y)
{
      if(x==71)
      {
            if(y==0)
            {
                  int y=expo(2,a[1],mod);
                  return y;
            }
            return 0;
      }
      if(a[x]==0)
      {
            return solve(x+1,y);
      }
      if(dp[x][y]!=-1)
            return dp[x][y];
      long long l=1,ans=0,ty=y;
      for(int i=0;i<f[x].size();i++)
      {
            if(ty&(1LL<<isP[f[x][i]]))
            {
                  ty&=~(1LL << isP[f[x][i]]);
            }
            else
            {
                  ty=ty|(1LL<<isP[f[x][i]]);
            }
      }
      //    debug2(y,f[x][0]);
      ans=(ans+(expo(2,a[x]-1,mod)*((solve(x+1,y)+solve(x+1,ty))%mod))%mod)%mod;
      dp[x][y]=ans;
      return ans;
      /*for(int i=0;i<=a[x];i++)
      {
            int g=(((fac[a[x]]*(expo(fac[i],mod-2,mod)))%mod)*(expo(fac[a[x]-i],mod-2,mod)))%mod;
            if(i==0)
            {
                  ans=(ans+solve(x+1,y))%mod;
            }
            else if(y==0)
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
            else
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
      }
      d[make_pair(x,y)]=ans;
      return ans;*/
}
int32_t main()
{
   IOS;
   #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
   #endif
   /********************* Code starts here ***********************/
   cin>>n;
   for(int i=0;i<71;i++)
   {
      for(int j=0;j<=(1LL<<19);j++)
      {
            dp[i][j]=-1;
      }
   }
   int p=0;
   for(int i=2;i<=70;i++)
   {
      if(isPrime(i))
      {
            isP[i]=p++;
      }
   }
   //cout<<p<<endl;
   for(int i=2;i<=70;i++)
   {
      int k=i;
      for(int j=2;j*j<=i;j++)
      {
            int c=0;
            while(k%j==0)
            {
                  c++;
                  k=k/j;
            }
            if(c%2==1)
            {
                  f[i].pb(j);
            }
            if(i%j==0)
            {
                  int u=i/j;
                  if(isPrime(u))
                  {
                        c=0;
                        k=i;
                        while(k%u==0)
                        {
                              c++;
                              k=k/u;
                        }
                        if(c%2==1)
                        {
                              f[i].pb(u);
                        }
                  }
            }
      }
   }
   for(int i=2;i<=70;i++)
   {
      if(f[i].size()==0 && isPrime(i))
            f[i].pb(i);
   }
   p=1;

   for(int i=0;i<n;i++)
   {
      int x;
      cin>>x;
      a[x]++;
   }
   int ans=(solve(2,0)-1+mod)%mod;
   cout<<ans<<endl;
}


#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define INF (1LL<<25)
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL<<61)
#define ull unsigned long long
#define debug1(x) cerr << #x << ": " << x <<'\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y <<'\n'
#define debug3(x, y, z) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z <<'\n'
using namespace std;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
int gcd(int x,int y)
{
    if(y==0)
        return x;
    else
        return gcd(y,x%y);
}
int expo(int n,int m,int p)   //modULAR EXPONENTIATION
{
    int r=1;
    n=n%p;
    while(m>0)
    {
        if(m%2)
            r=(r*n)%p;
        n=(n*n)%p;
        m=m/2;
    }
    return r%p;
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int n;
vector<int>a(71);
vector<int>f[76];
vector<int>fac(100005);
vector<int>isP(71);
map<pair<int,int>,int>d;
int solve(int x,int y)
{
      if(x==71)
      {
            if(y==0||y==1)
            {
                  int y=expo(2,a[1],mod);
                  return y;
            }
            return 0;
      }
      if(a[x]==0)
      {
            return solve(x+1,y);
      }
      if(d.find(mp(x,y))!=d.end())
      {
            return d[make_pair(x,y)];
      }
      int l=1,ans=0,ty=y;
      for(int i=0;i<f[x].size();i++)
      {
            if(ty&(1LL<<isP[f[x][i]]))
            {
                  ty&=~(1LL << isP[f[x][i]]);
            }
            else
            {
                  ty=ty|(1LL<<isP[f[x][i]]);
            }
      }
      ans=(ans+(expo(2,a[x]-1,mod)*(solve(x+1,y)+solve(x+1,ty)))%mod)%mod;
      d[make_pair(x,y)]=ans;
      return ans;
      /*for(int i=0;i<=a[x];i++)
      {
            int g=(((fac[a[x]]*(expo(fac[i],mod-2,mod)))%mod)*(expo(fac[a[x]-i],mod-2,mod)))%mod;
            if(i==0)
            {
                  ans=(ans+solve(x+1,y))%mod;
            }
            else if(y==0)
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
            else
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
      }
      d[make_pair(x,y)]=ans;
      return ans;*/
}
int32_t main()
{
   IOS;
   #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
   #endif
   /********************* Code starts here ***********************/
   cin>>n;

   int p=1;
   for(int i=2;i<=70;i++)
   {
      if(isPrime(i))
      {
            isP[i]=p++;
      }
   }
   for(int i=2;i<=70;i++)
   {
      int k=i;
      for(int j=2;j*j<=i;j++)
      {
            int c=0;
            while(k%j==0)
            {
                  c++;
                  k=k/j;
            }
            if(c%2==1)
            {
                  f[i].pb(j);
            }
            if(i%j==0)
            {
                  int u=i/j;
                  if(isPrime(u))
                  {
                        c=0;
                        k=i;
                        while(k%u==0)
                        {
                              c++;
                              k=k/u;
                        }
                        if(c%2==1)
                        {
                              f[i].pb(u);
                        }
                  }
            }
      }
   }
   for(int i=2;i<=70;i++)
   {
      if(f[i].size()==0)
            f[i].pb(i);
   }
   fac[0]=1;
   p=1;
   for(int i=1;i<=100000;i++)
   {
      p=(p*i)%mod;
      fac[i]=p;
   }
   for(int i=0;i<n;i++)
   {
      int x;
      cin>>x;
      a[x]++;
   }
   int ans=(solve(2,1)-1+mod)%mod;
   cout<<ans<<endl;
}


#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define INF (1LL<<25)
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL<<61)
#define ull unsigned long long
#define debug1(x) cerr << #x << ": " << x <<'\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y <<'\n'
#define debug3(x, y, z) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z <<'\n'
using namespace std;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
int gcd(int x,int y)
{
    if(y==0)
        return x;
    else
        return gcd(y,x%y);
}
int expo(int n,int m,int p)   //modULAR EXPONENTIATION
{
    int r=1;
    n=n%p;
    while(m>0)
    {
        if(m%2)
            r=(r*n)%p;
        n=(n*n)%p;
        m=m/2;
    }
    return r%p;
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}
int n;
vector<int>a(71);
vector<int>f[76];
vector<int>isP(71);
int dp[71][1<<19+1];
int solve(int x,int y)
{
      if(x==71)
      {
            if(y==0||y==1)
            {
                  int y=expo(2,a[1],mod);
                  return y;
            }
            return 0;
      }
      if(a[x]==0)
      {
            return solve(x+1,y);
      }
      if(dp[x][y]!=-1)
            return dp[x][y];
      int l=1,ans=0,ty=y;
      for(int i=0;i<f[x].size();i++)
      {
            if(ty&(1LL<<isP[f[x][i]]))
            {
                  ty&=~(1LL << isP[f[x][i]]);
            }
            else
            {
                  ty=ty|(1LL<<isP[f[x][i]]);
            }
      }
      ans=(ans+(expo(2,a[x]-1,mod)*(solve(x+1,y)+solve(x+1,ty)))%mod)%mod;
      dp[x][y]=ans;
      return ans;
      /*for(int i=0;i<=a[x];i++)
      {
            int g=(((fac[a[x]]*(expo(fac[i],mod-2,mod)))%mod)*(expo(fac[a[x]-i],mod-2,mod)))%mod;
            if(i==0)
            {
                  ans=(ans+solve(x+1,y))%mod;
            }
            else if(y==0)
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
            else
            {
                  if(i%2==0)
                  {
                        ans=(ans+(g*solve(x+1,y))%mod)%mod;
                  }
                  else
                  {
                        ans=(ans+(g*solve(x+1,ty))%mod)%mod;
                  }
            }
      }
      d[make_pair(x,y)]=ans;
      return ans;*/
}
int32_t main()
{
   IOS;
   #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
   #endif
   /********************* Code starts here ***********************/
   cin>>n;
   for(int i=0;i<71;i++)
   {
      for(int j=0;j<=(1LL<<19);j++)
      {
            dp[i][j]=-1;
      }
   }
   int p=1;
   for(int i=2;i<=70;i++)
   {
      if(isPrime(i))
      {
            isP[i]=p++;
      }
   }
   //cout<<p<<endl;
   for(int i=2;i<=70;i++)
   {
      int k=i;
      for(int j=2;j*j<=i;j++)
      {
            int c=0;
            while(k%j==0)
            {
                  c++;
                  k=k/j;
            }
            if(c%2==1)
            {
                  f[i].pb(j);
            }
            if(i%j==0)
            {
                  int u=i/j;
                  if(isPrime(u))
                  {
                        c=0;
                        k=i;
                        while(k%u==0)
                        {
                              c++;
                              k=k/u;
                        }
                        if(c%2==1)
                        {
                              f[i].pb(u);
                        }
                  }
            }
      }
   }
   for(int i=2;i<=70;i++)
   {
      if(f[i].size()==0)
            f[i].pb(i);
   }
   p=1;

   for(int i=0;i<n;i++)
   {
      int x;
      cin>>x;
      a[x]++;
   }
   int ans=(solve(2,1)-1+mod)%mod;
   cout<<ans<<endl;
}


#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) int((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl '\n'
#define ff first
#define ss second
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 1e5 + 5;
const int MAX_VAL = 70;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T add(T x, T y, T m = MOD) { return ((x % m)  + (y % m)) % m;}
template<typename T>   T mul(T x, T y, T m = MOD) { return ((x % m) * (long long)(y % m)) % m;}
template<typename T>   T sub(T x, T y, T m = MOD) { return add(x, -y + m);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}

int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

struct pair_hash{
	template<class T1, class T2>
	size_t operator() (const pair<T1, T2> &p) const {
		auto h1 = hash<T1>{}(p.first);
		auto h2 = hash<T2>{}(p.second);
		return h1 ^ h2;
	}
};

const int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71};

int n, a[MAXN], ppow[MAXN];
int preMask[MAX_VAL + 1], freq[MAX_VAL + 1];
int dp[MAX_VAL + 1][1 << 19];

void init() {
	for(int i = 1 ; i <= MAX_VAL ; ++i) {
		int mask = 0;
		int x = i;
		for(int j = 0; prime[j] <= x ; ++j) {
			while(x % prime[j] == 0) {
				x /= prime[j];
				mask ^= (1 << j);
			}
		}
		preMask[i] = mask;
	}

	ppow[0] = 1;
	for(int i = 1 ; i < MAXN ; ++i) {
		ppow[i] = mul(ppow[i - 1], 2);
	}
}

int solve(int i, int mask) {
	if(i == 0 && mask == 0) return 1;
	if(i == 0 && mask) return 0;
	int &ret = dp[i][mask];
	if(ret != -1) return ret;
	if(freq[i] == 0) return ret = solve(i - 1, mask);
	return ret = mul(ppow[freq[i] - 1], add(solve(i - 1, mask), solve(i - 1, mask ^ preMask[i])));
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	init();

	cin >> n;

	for(int i = 0 ; i < n ; ++i) {
		cin >> a[i];
		++freq[a[i]];
	}

	memset(dp, -1, sizeof dp);
	cout << sub(solve(70, 0), 1) << endl;

	return 0;
}


#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) int((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl '\n'
#define ff first
#define ss second
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 1e5 + 5;
const int MAX_VAL = 70;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T add(T x, T y, T m = MOD) { return ((x % m)  + (y % m)) % m;}
template<typename T>   T mul(T x, T y, T m = MOD) { return ((x % m) * (long long)(y % m)) % m;}
template<typename T>   T sub(T x, T y, T m = MOD) { return add(x, -y + m);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}

int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

struct pair_hash {
	template<class T1, class T2>
	size_t operator() (const pair<T1, T2> &p) const {
		auto h1 = hash<T1> {}(p.first);
		auto h2 = hash<T2> {}(p.second);
		return h1 ^ h2;
	}
};

const int prime[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71};

int n, a[MAXN], ppow[MAXN];
int mask[MAX_VAL + 1], freq[MAX_VAL + 1];
int dp[2][1 << 19];

void init() {
	for (int i = 1 ; i <= MAX_VAL ; ++i) {
		int umask = 0;
		int x = i;
		for (int j = 0; prime[j] <= x ; ++j) {
			while (x % prime[j] == 0) {
				x /= prime[j];
				umask ^= (1 << j);
			}
		}
		mask[i] = umask;
	}

	ppow[0] = 1;
	for (int i = 1 ; i < MAXN ; ++i) {
		ppow[i] = (ppow[i - 1] * 2LL) % MOD;
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	init();

	cin >> n;

	for (int i = 0 ; i < n ; ++i) {
		cin >> a[i];
		++freq[a[i]];
	}

	dp[0][0] = 1;
	bool last = 0;

	for (int i = 1 ; i <= 70 ; ++i) {
		if (!freq[i]) continue;

		for (int j = 0 ; j < (1 << 19) ; ++j) {
			dp[!last][j] = dp[last][j];
		}

		for (int j = 0 ; j < (1 << 19) ; ++j) {
			int a = mul(ppow[freq[i] - 1] - 1, dp[last][j]);
			int b = mul(ppow[freq[i] - 1], dp[last][j ^ mask[i]]);
			dp[!last][j] = add(dp[last][j], add(a, b));
		}

		last = !last;
	}

	cout << (dp[last][0] - 1 + MOD) % MOD << endl;

	return 0;
}


#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) int((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl '\n'
#define ff first
#define ss second
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 1e5 + 5;
const int MAX_VAL = 70;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T add(T x, T y, T m = MOD) { return ((x % m)  + (y % m)) % m;}
template<typename T>   T mul(T x, T y, T m = MOD) { return ((x % m) * (long long)(y % m)) % m;}
template<typename T>   T sub(T x, T y, T m = MOD) { return add(x, -y + m);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}

int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

struct pair_hash{
	template<class T1, class T2>
	size_t operator() (const pair<T1, T2> &p) const {
		auto h1 = hash<T1>{}(p.first);
		auto h2 = hash<T2>{}(p.second);
		return h1 ^ h2;
	}
};

const int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,57,59,61,67,71};

int n, a[MAXN], ppow[MAXN + 2];
int preMask[MAX_VAL + 1], freq[MAX_VAL + 1];
int dp[MAX_VAL + 1][1 << 19 + 2];

void init() {
	for(int i = 1 ; i <= MAX_VAL ; ++i) {
		int mask = 0;
		int x = i;
		for(int j = 0; prime[j] <= x ; ++j) {
			while(x % prime[j] == 0) {
				x /= prime[j];
				mask ^= (1 << j);
			}
		}
		preMask[i] = mask;
	}

	ppow[0] = 1;
	for(int i = 1 ; i < MAXN ; ++i) {
		ppow[i] = mul(ppow[i - 1], 2);
	}
}

int solve(int i, int mask) {
	if(i == 0 && mask == 0) return 1;
	if(i == 0 && mask) return 0;
	int &ret = dp[i][mask];
	if(ret != -1) return ret;
	if(freq[i] == 0) return ret = solve(i - 1, mask);
	return ret = mul(ppow[freq[i] - 1], add(solve(i - 1, mask), solve(i - 1, mask ^ preMask[i])));
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	init();

	cin >> n;

	for(int i = 0 ; i < n ; ++i) {
		cin >> a[i];
		++freq[a[i]];
	}

	memset(dp, -1, sizeof dp);
	cout << sub(solve(70, 0), 1) << endl;

	return 0;
}


#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) int((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl '\n'
#define ff first
#define ss second
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 1e5 + 5;
const int MAX_VAL = 70;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T add(T x, T y, T m = MOD) { return ((x % m)  + (y % m)) % m;}
template<typename T>   T mul(T x, T y, T m = MOD) { return ((x % m) * (long long)(y % m)) % m;}
template<typename T>   T sub(T x, T y, T m = MOD) { return add(x, -y + m);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}

int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

struct pair_hash{
	template<class T1, class T2>
	size_t operator() (const pair<T1, T2> &p) const {
		auto h1 = hash<T1>{}(p.first);
		auto h2 = hash<T2>{}(p.second);
		return h1 ^ h2;
	}
};

const int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,57,59,61,67,71};

int n, a[MAXN], ppow[MAXN];
int preMask[MAX_VAL + 1], freq[MAX_VAL + 1];
int dp[MAX_VAL + 1][1 << 19];

void init() {
	for(int i = 1 ; i <= MAX_VAL ; ++i) {
		int mask = 0;
		int x = i;
		for(int j = 0; prime[j] <= x ; ++j) {
			while(x % prime[j] == 0) {
				x /= prime[j];
				mask ^= (1 << j);
			}
		}
		preMask[i] = mask;
	}

	ppow[0] = 1;
	for(int i = 1 ; i < MAXN ; ++i) {
		ppow[i] = mul(ppow[i - 1], 2);
	}
}

int solve(int i, int mask) {
	if(i == 0 && mask == 0) return 1;
	if(i == 0 && mask) return 0;
	int &ret = dp[i][mask];
	if(ret != -1) return ret;
	if(freq[i] == 0) return ret = solve(i - 1, mask);
	return ret = mul(ppow[freq[i] - 1], add(solve(i - 1, mask), solve(i - 1, mask ^ preMask[i])));
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	init();

	cin >> n;

	for(int i = 0 ; i < n ; ++i) {
		cin >> a[i];
		++freq[a[i]];
	}

	memset(dp, -1, sizeof dp);
	cout << sub(solve(70, 0), 1) << endl;

	return 0;
}


#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) int((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl '\n'
#define ff first
#define ss second
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 1e5 + 5;
const int MAX_VAL = 70;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T add(T x, T y, T m = MOD) { return ((x % m)  + (y % m)) % m;}
template<typename T>   T mul(T x, T y, T m = MOD) { return ((x % m) * (long long)(y % m)) % m;}
template<typename T>   T sub(T x, T y, T m = MOD) { return add(x, -y + m);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}

int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

struct pair_hash{
	template<class T1, class T2>
	size_t operator() (const pair<T1, T2> &p) const {
		auto h1 = hash<T1>{}(p.first);
		auto h2 = hash<T2>{}(p.second);
		return h1 ^ h2;
	}
};

const int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,57,59,61,67,71};

int n, a[MAXN], bpow[MAXN];
int preMask[MAX_VAL + 1], freq[MAX_VAL + 1];
int dp[MAX_VAL + 1][1 << 19];

void init() {
	for(int i = 1 ; i <= MAX_VAL ; ++i) {
		int mask = 0;
		int x = i;
		for(int j = 0; prime[j] <= x ; ++j) {
			while(x % prime[j] == 0) {
				x /= prime[j];
				mask ^= (1 << j);
			}
		}
		preMask[i] = mask;
	}

	ppow[0] = 1;
	for(int i = 1 ; i < MAXN ; ++i) {
		ppow[i] = (ppow[i - 1] << 1);
		ppow[i] %= MOD;
	}
}

int solve(int i, int mask) {
	if(i == 0 && mask == 0) return 1;
	if(i == 0 && mask) return 0;
	int &ret = dp[i][mask];
	if(ret != -1) return ret;
	if(freq[i] == 0) return ret = solve(i - 1, mask);
	return ret = mul(ppow[freq[i] - 1], add(solve(i - 1, mask), solve(i - 1, mask ^ preMask[i])));
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	init();

	cin >> n;

	for(int i = 0 ; i < n ; ++i) {
		cin >> a[i];
		++freq[a[i]];
	}

	memset(dp, -1, sizeof dp);
	cout << solve(70, 0) - 1 << endl;

	return 0;
}


#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) int((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl '\n'
#define ff first
#define ss second
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 1e5 + 5;
const int MAX_VAL = 70;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T add(T x, T y, T m = MOD) { return ((x % m)  + (y % m)) % m;}
template<typename T>   T mul(T x, T y, T m = MOD) { return ((x % m) * (long long)(y % m)) % m;}
template<typename T>   T sub(T x, T y, T m = MOD) { return add(x, -y + m);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}

int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

struct pair_hash{
	template<class T1, class T2>
	size_t operator() (const pair<T1, T2> &p) const {
		auto h1 = hash<T1>{}(p.first);
		auto h2 = hash<T2>{}(p.second);
		return h1 ^ h2;
	}
};

const int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,57,59,61,67,71};

int n, a[MAXN], ppow[MAXN + 2;
int preMask[MAX_VAL + 1], freq[MAX_VAL + 1];
int dp[MAX_VAL + 1][1 << 19 + 2];

void init() {
	for(int i = 1 ; i <= MAX_VAL ; ++i) {
		int mask = 0;
		int x = i;
		for(int j = 0; prime[j] <= x ; ++j) {
			while(x % prime[j] == 0) {
				x /= prime[j];
				mask ^= (1 << j);
			}
		}
		preMask[i] = mask;
	}

	ppow[0] = 1;
	for(int i = 1 ; i < MAXN ; ++i) {
		ppow[i] = mul(ppow[i - 1], 2);
	}
}

int solve(int i, int mask) {
	if(i == 0 && mask == 0) return 1;
	if(i == 0 && mask) return 0;
	int &ret = dp[i][mask];
	if(ret != -1) return ret;
	if(freq[i] == 0) return ret = solve(i - 1, mask);
	return ret = mul(ppow[freq[i] - 1], add(solve(i - 1, mask), solve(i - 1, mask ^ preMask[i])));
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	init();

	cin >> n;

	for(int i = 0 ; i < n ; ++i) {
		cin >> a[i];
		++freq[a[i]];
	}

	memset(dp, -1, sizeof dp);
	cout << sub(solve(70, 0), 1) << endl;

	return 0;
}


#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) int((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl '\n'
#define ff first
#define ss second
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 1e5 + 5;
const int MAX_VAL = 70;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T add(T x, T y, T m = MOD) { return ((x % m)  + (y % m)) % m;}
template<typename T>   T mul(T x, T y, T m = MOD) { return ((x % m) * (long long)(y % m)) % m;}
template<typename T>   T sub(T x, T y, T m = MOD) { return add(x, -y + m);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}

int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

struct pair_hash{
	template<class T1, class T2>
	size_t operator() (const pair<T1, T2> &p) const {
		auto h1 = hash<T1>{}(p.first);
		auto h2 = hash<T2>{}(p.second);
		return h1 ^ h2;
	}
};

const int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,57,59,61,67,71};

int n, a[MAXN], ppow[MAXN];
int preMask[MAX_VAL + 1], freq[MAX_VAL + 1];
int dp[MAX_VAL + 1][1 << 19];

void init() {
	for(int i = 1 ; i <= MAX_VAL ; ++i) {
		int mask = 0;
		int x = i;
		for(int j = 0; prime[j] <= x ; ++j) {
			while(x % prime[j] == 0) {
				x /= prime[j];
				mask ^= (1 << j);
			}
		}
		preMask[i] = mask;
	}

	ppow[0] = 1;
	for(int i = 1 ; i < MAXN ; ++i) {
		ppow[i] = (ppow[i - 1] << 1);
		ppow[i] %= MOD;
	}
}

int solve(int i, int mask) {
	if(i == 0 && mask == 0) return 1;
	if(i == 0 && mask) return 0;
	int &ret = dp[i][mask];
	if(ret != -1) return ret;
	if(freq[i] == 0) return ret = solve(i - 1, mask);
	return ret = mul(ppow[freq[i] - 1], add(solve(i - 1, mask), solve(i - 1, mask ^ preMask[i])));
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	init();

	cin >> n;

	for(int i = 0 ; i < n ; ++i) {
		cin >> a[i];
		++freq[a[i]];
	}

	memset(dp, -1, sizeof dp);
	cout << solve(70, 0) - 1 << endl;

	return 0;
}


#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) int((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl '\n'
#define ff first
#define ss second
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 1e5 + 5;
const int MAX_VAL = 70;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T add(T x, T y, T m = MOD) { return ((x % m)  + (y % m)) % m;}
template<typename T>   T mul(T x, T y, T m = MOD) { return ((x % m) * (long long)(y % m)) % m;}
template<typename T>   T sub(T x, T y, T m = MOD) { return add(x, -y + m);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}

int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

struct pair_hash{
	template<class T1, class T2>
	size_t operator() (const pair<T1, T2> &p) const {
		auto h1 = hash<T1>{}(p.first);
		auto h2 = hash<T2>{}(p.second);
		return h1 ^ h2;
	}
};

const int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,57,59,61,67,71};

int n, a[MAXN], ppow[MAXN];
int preMask[MAX_VAL + 1], freq[MAX_VAL + 1];
int dp[MAX_VAL + 1][1 << 20];

void init() {
	for(int i = 1 ; i <= MAX_VAL ; ++i) {
		int mask = 0;
		int x = i;
		for(int j = 0; prime[j] <= x ; ++j) {
			while(x % prime[j] == 0) {
				x /= prime[j];
				mask ^= (1 << j);
			}
		}
		preMask[i] = mask;
	}

	ppow[0] = 1;
	for(int i = 1 ; i < MAXN ; ++i) {
		ppow[i] = mul(ppow[i - 1], 2);
	}
}

int solve(int i, int mask) {
	if(i == 0 && mask == 0) return 1;
	if(i == 0 && mask) return 0;
	int &ret = dp[i][mask];
	if(ret != -1) return ret;
	if(freq[i] == 0) return ret = solve(i - 1, mask);
	return ret = mul(ppow[freq[i] - 1], add(solve(i - 1, mask), solve(i - 1, mask ^ preMask[i])));
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	init();

	cin >> n;

	for(int i = 0 ; i < n ; ++i) {
		cin >> a[i];
		++freq[a[i]];
	}

	memset(dp, -1, sizeof dp);
	cout << sub(solve(70, 0), 1) << endl;

	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 1<<19;
const long long mod = 1e9+7;
const int M = 1e5+10;
long long prime[19] = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67 };
long long er[M];
long long dp[71][N];
long long n,m;
long long ni[72];
long long sc[N];
int main(){
	er[0] = 1;
	for(int i=1;i<M;i++){
		er[i] = 2*er[i-1]%mod;
	}
	//sc[1] = 1;
	for(int i=2;i<=70;i++){
		int x = i;
		for(int j=0;j<19;j++){
			while(x%prime[j]==0) sc[i] ^= (1<<j), x /= prime[j];
		}
	}
	while(~scanf("%lld",&n)){
		memset(ni,0,sizeof(ni));
		memset(dp,0,sizeof(dp));
		dp[0][0] = 1;
		for(int i=0;i<n;i++){
			long long x;
			scanf("%lld",&x);
			ni[x]++;
		}
		for(int i=1;i<=70;i++){
			for(int j=0;j<N;j++){
				if(ni[i]<1) dp[i][j] = dp[i-1][j];
				else dp[i][j] = (dp[i-1][j]+dp[i-1][j^sc[i]])%mod*er[ni[i]-1]%mod;
			}
		}
		printf("%lld\n",(dp[70][0] - 1 + mod)%mod);
	}

}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = (1<<18)+10;
const long long mod = 1e9+7;
const int M = 1e5+10;
long long prime[19] = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67 };
long long er[M];
long long dp[71][N];
long long n,m;
long long ni[72];
long long sc[N];
int main(){
	er[0] = 1;
	for(int i=1;i<M;i++){
		er[i] = 2*er[i-1]%mod;
	}
	//sc[1] = 1;
	for(int i=2;i<=70;i++){
		int x = i;
		for(int j=0;j<19;j++){
			while(x%prime[j]==0) sc[i] ^= (1<<j), x /= prime[j];
		}
	}
	while(~scanf("%lld",&n)){
		memset(ni,0,sizeof(ni));
		memset(dp,0,sizeof(dp));
		dp[0][0] = 1;
		for(int i=0;i<n;i++){
			long long x;
			scanf("%lld",&x);
			ni[x]++;
		}
		for(int i=1;i<=70;i++){
			for(int j=0;j<N;j++){
				if(ni[i]<1) dp[i][j] = dp[i-1][j];
				else dp[i][j] = (dp[i-1][j]+dp[i-1][j^sc[i]])%mod*er[ni[i]-1]%mod;
			}
		}
		printf("%lld\n",(dp[70][0] - 1 + mod)%mod);
	}

}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>

using namespace std;

#define LL long long
const int INF = 0x3f3f3f3f;
#define MAXN 60100
#define MAXM 1000100

const LL mod = 1e9 + 7;
int s[100],cnt[100];
int pri[19] = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67 };
int dp[71][1 << 19];
int a[100005];

int main()
{
    int n, x;
    for (int i = 2; i <= 70; i++)
    {
        int x = i;
        for (int j = 0; j < 19; j++)
        {
            while (x%pri[j] == 0) s[i] ^= (1 << j), x /= pri[j];
        }
    }
    a[0] = 1;
    for (int i = 1; i <= 100004; i++)
        a[i] = (2 * a[i - 1]) % mod;
    while (~scanf("%d", &n))
    {
        memset(cnt, 0, sizeof cnt);
        memset(dp, 0, sizeof dp);
        for (int i = 0; i < n; i++)
        {
            scanf("%d", &x);
            cnt[x]++;
        }
        dp[0][0] = 1;
        for (int i = 1; i <= 70; i++)
        {
            if (cnt[i] == 0)
            {
                for (int j = 0; j < (1 << 19); j++)
                    dp[i][j] = dp[i - 1][j];
                continue;
            }
            for (int j = 0; j < (1 << 19); j++)
            {
                dp[i][j^s[i]] = 1LL * (1LL*dp[i][j^s[i]] + 1LL*dp[i - 1][j] * a[cnt[i] - 1]) % mod;
                dp[i][j] = 1LL * (1LL*dp[i][j] + 1LL*dp[i - 1][j] * a[cnt[i] - 1]) % mod;
            }
        }
        printf("%d\n", (dp[70][0] - 1 + mod) % mod);

    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 1<<19;
const long long mod = 1e9+7;
const int M = 1e5+10;
long long prime[19] = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67 };
long long er[M];
long long dp[71][N/2+10];
long long n,m;
long long ni[72];
long long sc[N/2+10];
int main(){
	er[0] = 1;
	for(int i=1;i<M;i++){
		er[i] = 2*er[i-1]%mod;
	}
	//sc[1] = 1;
	for(int i=2;i<=70;i++){
		int x = i;
		for(int j=0;j<19;j++){
			while(x%prime[j]==0) sc[i] ^= (1<<j), x /= prime[j];
		}
	}
	while(~scanf("%lld",&n)){
		memset(ni,0,sizeof(ni));
		memset(dp,0,sizeof(dp));
		dp[0][0] = 1;
		for(int i=0;i<n;i++){
			long long x;
			scanf("%lld",&x);
			ni[x]++;
		}
		for(int i=1;i<=70;i++){
			for(int j=0;j<N;j++){
				if(ni[i]<1) dp[i][j] = dp[i-1][j];
				else dp[i][j] = (dp[i-1][j]+dp[i-1][j^sc[i]])%mod*er[ni[i]-1]%mod;
			}
		}
		printf("%lld\n",(dp[70][0] - 1 + mod)%mod);
	}

}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = (1<<19);
const long long mod = 1e9+7;
const int M = 1e5+10;
long long prime[19] = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67 };
long long er[M];
long long dp[71][N];
long long n,m;
long long ni[72];
long long sc[72];
int main(){
	er[0] = 1;
	for(int i=1;i<M;i++){
		er[i] = 2*er[i-1]%mod;
	}
	//sc[1] = 1;
	for(int i=2;i<=70;i++){
		int x = i;
		for(int j=0;j<19;j++){
			while(x%prime[j]==0) sc[i] ^= (1<<j), x /= prime[j];
		}
	}
	while(~scanf("%lld",&n)){
		memset(ni,0,sizeof(ni));
		memset(dp,0,sizeof(dp));
		dp[0][0] = 1;
		for(int i=0;i<n;i++){
			long long x;
			scanf("%lld",&x);
			ni[x]++;
		}
		for(int i=1;i<=70;i++){
			for(int j=0;j<N;j++){
				if(ni[i]<1) dp[i][j] = dp[i-1][j];
				else dp[i][j] = (dp[i-1][j]+dp[i-1][j^sc[i]])%mod*er[ni[i]-1]%mod;
			}
		}
		printf("%lld\n",(dp[70][0] - 1 + mod)%mod);
	}

}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = (1<<19);
const long long mod = 1e9+7;
const int M = 1e5+10;
long long prime[19] = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67 };
long long er[M];
long long dp[2][N];
long long n,m;
long long ni[72];
long long sc[72];
int main(){
	er[0] = 1;
	for(int i=1;i<M;i++){
		er[i] = 2*er[i-1]%mod;
	}
	//sc[1] = 1;
	for(int i=2;i<=70;i++){
		int x = i;
		for(int j=0;j<19;j++){
			while(x%prime[j]==0) sc[i] ^= (1<<j), x /= prime[j];
		}
	}
	while(~scanf("%lld",&n)){
		memset(ni,0,sizeof(ni));
		memset(dp,0,sizeof(dp));
		dp[0][0] = 1;
		for(int i=0;i<n;i++){
			long long x;
			scanf("%lld",&x);
			ni[x]++;
		}
		for(int i=1;i<=70;i++){
			for(int j=0;j<N;j++){
				if(ni[i]<1) dp[i&1][j] = dp[(i-1)&1][j];
				else dp[i&1][j] = (dp[(i-1)&1][j]+dp[(i-1)&1][j^sc[i]])%mod*er[ni[i]-1]%mod;
			}
		}
		printf("%lld\n",(dp[70&1][0] - 1 + mod)%mod);
	}

}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 1<<19;
const long long mod = 1e9+7;
const int M = 1e5+10;
long long prime[19] = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67 };
long long er[M];
long long dp[72][N];
long long n,m;
long long ni[72];
long long sc[N];
int main(){
	er[0] = 1;
	for(int i=1;i<M;i++){
		er[i] = 2*er[i-1]%mod;
	}
	//sc[1] = 1;
	for(int i=2;i<=70;i++){
		int x = i;
		for(int j=0;j<19;j++){
			while(x%prime[j]==0) sc[i] ^= (1<<j), x /= prime[j];
		}
	}
	while(~scanf("%lld",&n)){
		memset(ni,0,sizeof(ni));
		memset(dp,0,sizeof(dp));
		dp[0][0] = 1;
		for(int i=0;i<n;i++){
			long long x;
			scanf("%lld",&x);
			ni[x]++;
		}
		for(int i=1;i<=70;i++){
			for(int j=0;j<N;j++){
				if(ni[i]<1) dp[i][j] = dp[i-1][j];
				else dp[i][j] = (dp[i-1][j]+dp[i-1][j^sc[i]])%mod*er[ni[i]-1]%mod;
			}
		}
		printf("%lld\n",(dp[70][0] - 1 + mod)%mod);
	}

}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>

using namespace std;

#define LL long long
const int INF = 0x3f3f3f3f;
#define MAXN 60100
#define MAXM 1000100

const LL mod = 1e9 + 7;
int s[100],cnt[100];
int pri[19] = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67 };
int dp[71][1 << 19];
int a[100005];

int main()
{
    int n, x;
    for (int i = 2; i <= 70; i++)
    {
        int x = i;
        for (int j = 0; j < 19; j++)
        {
            while (x%pri[j] == 0) s[i] ^= (1 << j), x /= pri[j];
        }
    }
    a[0] = 1;
    for (int i = 1; i <= 100004; i++)
        a[i] = (2 * a[i - 1]) % mod;
    while (~scanf("%d", &n))
    {
        memset(cnt, 0, sizeof cnt);
        memset(dp, 0, sizeof dp);
        for (int i = 0; i < n; i++)
        {
            scanf("%d", &x);
            cnt[x]++;
        }
        dp[0][0] = 1;
        for (int i = 1; i <= 70; i++)
        {
            if (cnt[i] == 0)
            {
                for (int j = 0; j < (1 << 19); j++)
                    dp[i][j] = dp[i - 1][j];
                continue;
            }
            for (int j = 0; j < (1 << 19); j++)
            {
                dp[i][j^s[i]] = 1LL * (1LL*dp[i][j^s[i]] + 1LL*dp[i - 1][j] * a[cnt[i] - 1]) % mod;
                dp[i][j] = 1LL * (1LL*dp[i][j] + 1LL*dp[i - 1][j] * a[cnt[i] - 1]) % mod;
            }
        }
        printf("%d\n", (dp[70][0] - 1 + mod) % mod);

  //

    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = (1<<19);
const long long mod = 1e9+7;
const int M = 1e5+10;
long long prime[19] = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67 };
long long er[M];
long long dp[2][N];
long long n,m;
long long ni[72];
long long sc[72];
int main(){
	er[0] = 1;
	for(int i=1;i<M;i++){
		er[i] = 2*er[i-1]%mod;
	}
	//sc[1] = 1;
	for(int i=2;i<=70;i++){
		int x = i;
		for(int j=0;j<19;j++){
			while(x%prime[j]==0) sc[i] ^= (1<<j), x /= prime[j];
		}
	}
	while(~scanf("%lld",&n)){
		memset(ni,0,sizeof(ni));
		memset(dp,0,sizeof(dp));
		dp[0][0] = 1;
		for(int i=0;i<n;i++){
			long long x;
			scanf("%lld",&x);
			ni[x]++;
		}
		for(int i=1;i<=70;i++){
			for(int j=0;j<N;j++){
				if(ni[i]<1) dp[i&1][j] = dp[(i-1)&1][j];
				else dp[i&1][j] = (dp[(i-1)&1][j]+dp[(i-1)&1][j^sc[i]])%mod*er[ni[i]-1]%mod;
			}
		}
		printf("%lld\n",(dp[70][0] - 1 + mod)%mod);
	}

}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll M = 7 + 1e9;
int n,x,a[71],Masks[71],dp[71][5| 1<<19];
ll Fact[100003];
bool vv[80];
int Fast_Power(ll &x,int p)
{
    if( !p )
        return 1;
    ll y=Fast_Power(x,p>>1);
    y *= y;
    y %= M;
    if( p&1 )
        y *= x,y %= M;
    return y;
}
ll C(int &n,int &r)
{
    ll TT = Fact[n-r]*Fact[r] %M;
     return Fact[n]*Fast_Power(TT,M-2)%M;
}
ll Try(int i,int mask)
{
    if(i>70)
        return !mask;
    int &ret = dp[i][mask];
    if(ret!=-1)
        return ret;
    ret = 0;
    for(int j=0; j<=a[i];ret -= M*(ret>=M) , j++)
        if( j&1 )
            ret += C(a[i],j) * Try(i+1,mask^Masks[i])%M;
        else
            ret += C(a[i],j ) * Try(i+1,mask)%M;
    return ret;
}
int main()
{
    Fact[0] = 1;
    for(int i=1; i<=1e5; i++)
        Fact[i]=Fact[i-1]*i%M;
    for(int i=2,cc=0; i<=70; i++)
        if(!vv[i])
        {
            for(int j=1,k=i; k<=70; vv[k]=1,k+=i,j++)
                Masks[k] |= Masks[k/i] ^ (1<<cc);
            cc++;
        }
    cin >> n;
    for(int i=0; i<n; i++)
    {
        scanf("%d",&x);
        a[x]++;
    }
    memset(dp,-1,sizeof(dp));
    cout << Try(1,0)-1 << endl;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll M = 7 + 1e9;
int n,x,a[71],Masks[71],dp[71][1<<19|5],Fact[100001];
bool vv[80];
int Fast_Power(ll x,int p)
{
    if(!p)
        return 1;
    ll y=Fast_Power(x,p>>1);
    y = y*y%M;
    if(p&1)
        y = y*x%M;
    return y;
}
ll C(ll n,int r)
{
    return (ll) Fact[n]*(ll) Fast_Power((ll)Fact[n-r]*(ll) Fact[r]%M,M-2)%M;
}
ll Try(int i,int mask)
{
    if(i>70)
        return !mask;
    int &ret = dp[i][mask];
    if(ret!=-1)
        return ret;
    ret = 0;
    for(int j=0; j<=a[i];ret%=M, j++)
        if(j&1)
            ret += (ll) C(a[i],j ) * (ll) Try(i+1,mask^Masks[i])%M;
        else
            ret+= (ll) C(a[i],j ) * (ll) Try(i+1,mask)%M;
    return ret;
}
int main()
{
    Fact[0] = 1;
    for(int i=1; i<=1e5; i++)
        Fact[i]=Fact[i-1]*i%M;
    for(int i=2,cc=0; i<=70; i++)
        if(!vv[i])
        {
            for(int j=1,k=i; k<=70; vv[k]=1,k+=i,j++)
                Masks[k] |= Masks[k/i] ^ (1<<cc);
            cc++;
        }
    cin >> n;
    for(int i=0; i<n; i++)
    {
        cin >> x;
        a[x]++;
    }
    memset(dp,-1,sizeof(dp));
    cout << Try(1,0)-1 << endl;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll M = 7 + 1e9;
int n,x,a[71],Masks[71],dp[71][5| 1<<19],C[100005];
bool vv[71];
ll Try(int i,int mask)
{
    if(i>70)
        return !mask;
    int& ret = dp[i][mask];
    if(ret!=-1)
        return ret;
    if(a[i])
        ret = (ll) C[a[i]]*( (Try(i+1,mask) + Try(i+1,mask^Masks[i]))%M)%M;
        else ret = Try(i+1,mask);
    ret%=M;
    return ret;
}
int main()
{
    C[1] = 1;
    for(int i=2; i<=1e5; i++)
        C[i] = C[i-1]<<1,C[i] -= M*(C[i] >= M );
    for(int i=2,cc=0; i<=70; i++)
        if(!vv[i])
        {
            for(int j=1,k=i; k<=70; vv[k]=1,k+=i,j++)
                Masks[k] |= Masks[k/i] ^ (1<<cc);
            cc++;
        }
    cin >> n;
    for(int i=0; i<n; i++)
    {
        scanf("%d",&x);
        a[x]++;
    }
    memset(dp,-1,sizeof(dp));
    cout << Try(1,0)-1 << endl;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll M = 7 + 1e9;
ll n,x,a[80],Masks[80],dp[80][1<<19|5],Fact[100005];
bool vv[80];
ll Fast_Power(ll x,int p)
{
    if(!p)
        return 1;
    ll y=Fast_Power(x,p>>1);
    y = y*y%M;
    if(p&1)
        y = y*x%M;
    return y;
}
ll C(int n,int r)
{
    return Fact[n]*Fast_Power(Fact[n-r]*Fact[r]%M,M-2)%M;
}
ll Try(int i,int mask)
{
    if(i>70)
        return !mask;
    ll &ret = dp[i][mask];
    if(ret!=-1)
        return ret;
    ret = 0;
    for(int j=0; j<=a[i]; j++)
        if(j&1)
            ret += C(a[i],j ) * Try(i+1,mask^Masks[i]);
        else
            ret += C(a[i],j ) * Try(i+1,mask);
    return ret;
}
int main()
{
    Fact[0] = 1;
    for(int i=1; i<=1e5; i++)
        Fact[i]=Fact[i-1]*i%M;
    for(int i=2,cc=0; i<=70; i++)
        if(!vv[i])
        {
            for(int j=1,k=i; k<=70; vv[k]=1,k+=i,j++)
                Masks[k] |= Masks[k/i] ^ (1<<cc);
            cc++;
        }
    cin >> n;
    for(int i=0; i<n; i++)
    {
        cin >> x;
        a[x]++;
    }
    memset(dp,-1,sizeof(dp));
    cout << Try(1,0)-1 << endl;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll M = 7 + 1e9;
int n,x,a[71],Masks[71],dp[71][1<<19|5],Fact[100001];
bool vv[80];
int Fast_Power(ll x,int p)
{
    if(!p)
        return 1;
    ll y=Fast_Power(x,p>>1);
    y = y*y%M;
    if(p&1)
        y = y*x%M;
    return y;
}
int C(int n,int r)
{
    return Fact[n]*Fast_Power(Fact[n-r]*Fact[r]%M,M-2)%M;
}
int Try(int i,int mask)
{
    if(i>70)
        return !mask;
    int &ret = dp[i][mask];
    if(ret!=-1)
        return ret;
    ll tmp=0;
    for(int j=0; j<=a[i];tmp%=M, j++)
        if(j&1)
            tmp += (ll) C(a[i],j ) * (ll) Try(i+1,mask^Masks[i])%M;
        else
            tmp += (ll) C(a[i],j ) * (ll) Try(i+1,mask)%M;
    return ret=tmp;
}
int main()
{
    Fact[0] = 1;
    for(int i=1; i<=1e5; i++)
        Fact[i]=Fact[i-1]*i%M;
    for(int i=2,cc=0; i<=70; i++)
        if(!vv[i])
        {
            for(int j=1,k=i; k<=70; vv[k]=1,k+=i,j++)
                Masks[k] |= Masks[k/i] ^ (1<<cc);
            cc++;
        }
    cin >> n;
    for(int i=0; i<n; i++)
    {
        cin >> x;
        a[x]++;
    }
    memset(dp,-1,sizeof(dp));
    cout << Try(1,0)-1 << endl;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll M = 7 + 1e9;
ll n,x,a[71],Masks[71],dp[71][1<<19|5],Fact[100001];
bool vv[80];
int Fast_Power(ll x,int p)
{
    if(!p)
        return 1;
    ll y=Fast_Power(x,p>>1);
    y = y*y%M;
    if(p&1)
        y = y*x%M;
    return y;
}
int C(int n,int r)
{
    return Fact[n]*Fast_Power(Fact[n-r]*Fact[r]%M,M-2)%M;
}
int Try(int i,int mask)
{
    if(i>70)
        return !mask;
    ll &ret = dp[i][mask];
    if(ret!=-1)
        return ret;
    ret = 0;
    for(int j=0; j<=a[i];res%=M, j++)
        if(j&1)
            ret += (ll) C(a[i],j ) * (ll) Try(i+1,mask^Masks[i])%M;
        else
            ret += (ll) C(a[i],j ) * (ll) Try(i+1,mask)%M;
    return ret;
}
int main()
{
    Fact[0] = 1;
    for(int i=1; i<=1e5; i++)
        Fact[i]=Fact[i-1]*i%M;
    for(int i=2,cc=0; i<=70; i++)
        if(!vv[i])
        {
            for(int j=1,k=i; k<=70; vv[k]=1,k+=i,j++)
                Masks[k] |= Masks[k/i] ^ (1<<cc);
            cc++;
        }
    cin >> n;
    for(int i=0; i<n; i++)
    {
        cin >> x;
        a[x]++;
    }
    memset(dp,-1,sizeof(dp));
    cout << Try(1,0)-1 << endl;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll M = 7 + 1e9;
ll n,x,a[80],Masks[80],dp[80][1<<18|5],Fact[100005];
bool vv[80];
ll Fast_Power(ll x,int p)
{
    if(!p)
        return 1;
    ll y=Fast_Power(x,p>>1);
    y = y*y%M;
    if(p&1)
        y = y*x%M;
    return y;
}
ll C(int n,int r)
{
    return Fact[n]*Fast_Power(Fact[n-r]*Fact[r]%M,M-2)%M;
}
ll Try(int i,int mask)
{
    if(i>70)
        return !mask;
    ll &ret = dp[i][mask];
    if(ret!=-1)
        return ret;
    ret = 0;
    for(int j=0; j<=a[i]; j++)
        if(j&1)
            ret += C(a[i],j ) * Try(i+1,mask^Masks[i]);
        else
            ret += C(a[i],j ) * Try(i+1,mask);
    return ret;
}
int main()
{
    Fact[0] = 1;
    for(int i=1; i<=1e5; i++)
        Fact[i]=Fact[i-1]*i%M;
    for(int i=2,cc=0; i<=70; i++)
        if(!vv[i])
        {
            for(int j=1,k=i; k<=70; vv[k]=1,k+=i,j++)
                Masks[k] |= Masks[k/i] ^ (1<<cc);
            cc++;
        }
    cin >> n;
    for(int i=0; i<n; i++)
    {
        cin >> x;
        a[x]++;
    }
    memset(dp,-1,sizeof(dp));
    cout << Try(1,0)-1 << endl;
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll M = 7 + 1e9;
ll n,x,a[71],Masks[71],dp[71][1<<19|5],Fact[100001];
bool vv[80];
int Fast_Power(ll x,int p)
{
    if(!p)
        return 1;
    ll y=Fast_Power(x,p>>1);
    y = y*y%M;
    if(p&1)
        y = y*x%M;
    return y;
}
int C(int n,int r)
{
    return Fact[n]*Fast_Power(Fact[n-r]*Fact[r]%M,M-2)%M;
}
int Try(int i,int mask)
{
    if(i>70)
        return !mask;
    ll &ret = dp[i][mask];
    if(ret!=-1)
        return ret;
    ret = 0;
    for(int j=0; j<=a[i];ret%=M, j++)
        if(j&1)
            ret += (ll) C(a[i],j ) * (ll) Try(i+1,mask^Masks[i])%M;
        else
            ret += (ll) C(a[i],j ) * (ll) Try(i+1,mask)%M;
    return ret;
}
int main()
{
    Fact[0] = 1;
    for(int i=1; i<=1e5; i++)
        Fact[i]=Fact[i-1]*i%M;
    for(int i=2,cc=0; i<=70; i++)
        if(!vv[i])
        {
            for(int j=1,k=i; k<=70; vv[k]=1,k+=i,j++)
                Masks[k] |= Masks[k/i] ^ (1<<cc);
            cc++;
        }
    cin >> n;
    for(int i=0; i<n; i++)
    {
        cin >> x;
        a[x]++;
    }
    memset(dp,-1,sizeof(dp));
    cout << Try(1,0)-1 << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...)// fprintf(stderr,args)
#else
#define debug(args...)
#endif //ONLINE_JUDGE
template<typename T> inline T abs(T t) { return t < 0? -t : t; }
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }

const int MAXN = 212345, BIT = (1<<20) + 10;

int n, m, k;

int s[MAXN];
int mrk[MAXN];

ll cnt[2][BIT];

int pri[MAXN][20];

ll res;
vector<int> p;

void f(int i){
	for(int ip =0;ip < p.size();ip++){
		int pr = p[ip];
		while(s[i]%pr == 0){
			pri[i][ip]++;
			s[i]/=pr;
		}
	}
}

int ac(int i){
	int c = 0;
	for(int a=0;a<20;a++){
		if(pri[i][a]&1)
			c ^= (1<<a);
	}
	return c;
}

int main (){
	for(int a=2;a<=70;a++){
		if(mrk[a]) continue;
		p.pb(a);
		for(int b=a;b*a <= 70;b++){
			mrk[b*a] = 1;
		}
	}
	scanf("%d", &n);
	for(int a=0;a<n;a++){
		scanf("%d", &s[a]);
		f(a);
	}
	cnt[0][0] = 1;
	for(int i=0;i<n;i++){
		int t = (i&1);
		int bm = ac(i);
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = 0;
		for(int a=0;a<BIT;a++){
			if(cnt[t][a] != 0)
				cnt[t^1][a^bm] = mod(cnt[t^1][a^bm] + cnt[t][a]);
		}
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = mod(cnt[t^1][a] + cnt[t][a]);
	}
	printf("%lld\n", mod(modn + mod(cnt[(n&1)][0]-1)));
}


#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(stderr,args)
#else
#define debug(args...)
#endif //ONLINE_JUDGE
template<typename T> inline T abs(T t) { return t < 0? -t : t; }
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }

const int MAXN = 1123456, LOGN = 20;

int n, m, k;
int s[MAXN];

vector<int> pri;

int f(int x){
	int ans = 0;
	for(int i  =0;i < pri.size();i++){
		int p = pri[i];
		while(x % p == 0){
			x /= p;
			ans ^= (1<<i);
		}
	}
	return ans;
}

ll dp[2][MAXN], cnt[MAXN];
int mrk[100];

ll expo(ll base, ll e){
	if(e == 0) return 1;
	ll ans = expo(base, e/2ll);
	ans = mod(ans*ans);
	if(e&1) ans = mod(ans*base);
	return ans;
}

int main (){
	for(int a=2;a<=70;a++){
		if(mrk[a]) continue;
		pri.pb(a);
		for(int b=a;b*a <= 70;b++)
			mrk[a*b] = 1;
	}
	scanf("%d", &n);
	for(int a=0;a<n;a++){
		scanf("%d", s+a);
		s[a] = f(s[a]);
		cnt[s[a]]++;
	}
	int t = 0;
	dp[0][0] = expo(2, cnt[0]);
	for(int x=1;x<MAXN;x++){
		if(cnt[x] == 0) continue;
		for(int a=0;a<MAXN;a++)
			dp[t^1][a] = 0;
		for(int a=0;a<MAXN;a++){
			if(dp[t][a] == 0) continue;
			ll som = mod(dp[t][a] + dp[t][a^x]);
			debug("som %lld de %d e %d\n", som, a, a^x);
			ll val = mod(som*expo(2, cnt[x]-1));
			debug("val %lld cnt[%d] %lld\n", val, x, cnt[x]);
			dp[t^1][a] = mod(dp[t^1][a] + val);
			dp[t^1][a^x] = mod(dp[t^1][a^x] + val);
		}
		t = t^1;
	}
	printf("%lld\n", dp[t][0] - 1);
}


#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(stderr,args)
#else
#define debug(args...)
#endif //ONLINE_JUDGE
template<typename T> inline T abs(T t) { return t < 0? -t : t; }
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }

const int MAXN = 212345, BIT = (1<<21) + 10;

int n, m, k;

int s[MAXN];
int mrk[MAXN];

ll cnt[2][BIT];

ll qtd[73];

int pri[73][22];

ll pot[MAXN];

ll res;
vector<int> p;

void f(int i){
	int ii = i;
	for(int ip =0;ip < p.size();ip++){
		int pr = p[ip];
		while(ii%pr == 0){
			pri[i][ip]++;
			ii/=pr;
		}
	}
}

int ac(int i){
	int c = 0;
	for(int a=0;a<21;a++){
		if((pri[i][a]&1))
			c ^= (1<<a);
	}
	return c;
}

int main (){
	for(int a=2;a<=70;a++){
		if(mrk[a]) continue;
		p.pb(a);
		for(int b=a;b*a <= 70;b++){
			mrk[b*a] = 1;
		}
	}
	for(int a=1;a<=70;a++){
		f(a);
	}
	scanf("%d", &n);
	for(int a=0;a<n;a++){
		scanf("%d", &s[a]);
		int bm = ac(s[a]);
		qtd[bm]++;
	}
	pot[0] =1;
	for(int a=1;a<=n;a++){
		pot[a] = mod(2ll*pot[a-1]);
	}
	int t = 0;
	cnt[0][0] = 1;
	for(int i=0;i<=70;i++){
		if(qtd[i] == 0) continue;
		int bm = i;
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = 0;
		for(int a=0;a<BIT;a++){
			if(cnt[t][a] != 0){
				ll old = cnt[t][a];
				ll old2 = cnt[t^1][a^bm];
				cnt[t^1][a] = mod(cnt[t^1][a] + cnt[t][a]*pot[qtd[i]-1]);
				cnt[t^1][a^bm] = mod(cnt[t^1][a^bm] + old*pot[qtd[i]-1]);
			}
		}
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = mod(cnt[t^1][a] + cnt[t][a]);
		/*for(int a=0;a<10;a++)
			debug("%d ", cnt[t^1][a]);
		debug("\n");*/
		t = t^1;
	}
	printf("%lld\n", mod(modn + mod(cnt[(t&1)][0]-1)));
}


#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(stderr,args)
#else
#define debug(args...)
#endif //ONLINE_JUDGE
template<typename T> inline T abs(T t) { return t < 0? -t : t; }
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }

const int MAXN = 212345, BIT = (1<<20) + 10;

int n, m, k;

int s[MAXN];
int mrk[MAXN];

ll cnt[2][BIT];

ll qtd[73];

int pri[MAXN][22];

ll pot[MAXN];

ll res;
vector<int> p;

void f(int i){
	int ii = i;
	for(int ip =0;ip < p.size();ip++){
		int pr = p[ip];
		while(ii%pr == 0){
			pri[i][ip]++;
			ii/=pr;
		}
	}
}

int ac(int i){
	int c = 0;
	for(int a=0;a<20;a++){
		if(pri[i][a]&1)
			c ^= (1<<a);
	}
	return c;
}

int main (){
	for(int a=2;a<=70;a++){
		if(mrk[a]) continue;
		p.pb(a);
		for(int b=a;b*a <= 70;b++){
			mrk[b*a] = 1;
		}
	}
	scanf("%d", &n);
	for(int a=0;a<n;a++){
		scanf("%d", &s[a]);
		qtd[s[a]]++;
	}
	pot[0] =1;
	for(int a=1;a<=n;a++){
		pot[a] = mod(2ll*pot[a-1]);
	}
	for(int a=1;a<=70;a++){
		f(a);
	}
	int t = 0;
	cnt[0][0] = 1;
	for(int i=1;i<=70;i++){
		if(qtd[i] == 0) continue;
		int bm = ac(i);
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = 0;
		for(int a=0;a<BIT;a++){
			if(cnt[t][a] != 0)
				cnt[t][a] = mod(cnt[t][a]*pot[qtd[i]-1]);
				cnt[t^1][a^bm] = mod(cnt[t^1][a^bm] + cnt[t][a]);
		}
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = mod(cnt[t^1][a] + cnt[t][a]);
		/*for(int a=0;a<10;a++)
			debug("%d ", cnt[t^1][a]);
		debug("\n");*/
		t = t^1;
	}
	printf("%lld\n", mod(modn + mod(cnt[(t&1)][0]-1)));
}


#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(stderr,args)
#else
#define debug(args...)
#endif //ONLINE_JUDGE
template<typename T> inline T abs(T t) { return t < 0? -t : t; }
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }

const int MAXN = 212345, BIT = (1<<21) + 10;

int n, m, k;

int s[MAXN];
int mrk[MAXN];

ll cnt[2][BIT];

ll qtd[73];

int pri[73][22];

ll pot[MAXN];

ll res;
vector<int> p;

void f(int i){
	int ii = i;
	for(int ip =0;ip < p.size();ip++){
		int pr = p[ip];
		while(ii%pr == 0){
			pri[i][ip]++;
			ii/=pr;
		}
	}
}

int ac(int i){
	int c = 0;
	for(int a=0;a<21;a++){
		if((pri[i][a]&1))
			c ^= (1<<a);
	}
	return c;
}

int main (){
	for(int a=2;a<=70;a++){
		if(mrk[a]) continue;
		p.pb(a);
		for(int b=a;b*a <= 70;b++){
			mrk[b*a] = 1;
		}
	}
	for(int a=1;a<=70;a++){
		f(a);
	}
	scanf("%d", &n);
	for(int a=0;a<n;a++){
		scanf("%d", &s[a]);
		int bm = ac(s[a]);
		qtd[bm]++;
	}
	pot[0] =1;
	for(int a=1;a<=n;a++){
		pot[a] = mod(2ll*pot[a-1]);
	}
	int t = 0;
	cnt[0][0] = 1;
	for(int i=0;i<=70;i++){
		if(qtd[i] == 0) continue;
		int bm = i;
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = 0;
		for(int a=0;a<BIT;a++){
			if(cnt[t][a] != 0)
				cnt[t][a] = mod(cnt[t][a]*pot[qtd[i]-1]);
				if(a^bm < BIT) cnt[t^1][a^bm] = mod(cnt[t^1][a^bm] + cnt[t][a]);
		}
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = mod(cnt[t^1][a] + cnt[t][a]);
		/*for(int a=0;a<10;a++)
			debug("%d ", cnt[t^1][a]);
		debug("\n");*/
		t = t^1;
	}
	printf("%lld\n", mod(modn + mod(cnt[(t&1)][0]-1)));
}


#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(stderr,args)
#else
#define debug(args...)
#endif //ONLINE_JUDGE
template<typename T> inline T abs(T t) { return t < 0? -t : t; }
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }

const int MAXN = 1123456, LOGN = 20;

int n, m, k;
int s[MAXN];

vector<int> pri;

int f(int x){
	int ans = 0;
	for(int i  =0;i < pri.size();i++){
		int p = pri[i];
		while(x % p == 0){
			x /= p;
			ans ^= (1<<i);
		}
	}
	return ans;
}

ll dp[2][MAXN], ps[2][MAXN], cnt[MAXN];
int mrk[100];

ll expo(ll base, ll e){
	if(e == 0) return 1;
	ll ans = expo(base, e/2ll);
	ans = mod(ans*ans);
	if(e&1) ans = mod(ans*base);
	return ans;
}

int main (){
	for(int a=2;a<=70;a++){
		if(mrk[a]) continue;
		pri.pb(a);
		for(int b=a;b*a <= 70;b++)
			mrk[a*b] = 1;
	}
	scanf("%d", &n);
	for(int a=0;a<n;a++){
		scanf("%d", s+a);
		s[a] = f(s[a]);
		cnt[s[a]]++;
	}
	int t = 0;
	dp[0][0] = expo(2, cnt[0]);
	for(int x=1;x<MAXN;x++){
		if(cnt[x] == 0) continue;
		for(int a=0;a<MAXN;a++){
			dp[t^1][a] = 0;
			ps[t^1][a] = 0;
		}
		for(int a=0;a<MAXN;a++){
			if(dp[t][a] == 0 || ps[t][a]) continue;
			ll som = mod(dp[t][a] + dp[t][a^x]);
			ps[t][a^x] = 1;
			debug("som %lld de %d e %d\n", som, a, a^x);
			ll val = mod(som*expo(2, cnt[x]-1));
			debug("val %lld cnt[%d] %lld\n", val, x, cnt[x]);
			dp[t^1][a] = mod(dp[t^1][a] + val);
			dp[t^1][a^x] = mod(dp[t^1][a^x] + val);
		}
		t = t^1;
		for(int a=0;a<10;a++)
			debug("%lld ", dp[t][a]);
		puts("");
	}
	printf("%lld\n", dp[t][0] - 1);
}


#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(stderr,args)
#else
#define debug(args...)
#endif //ONLINE_JUDGE
template<typename T> inline T abs(T t) { return t < 0? -t : t; }
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }

const int MAXN = 212345, BIT = (1<<21) + 10;

int n, m, k;

int s[MAXN];
int mrk[MAXN];

ll cnt[2][BIT];

ll qtd[73];

int pri[73][22];

ll pot[MAXN];

ll res;
vector<int> p;

void f(int i){
	int ii = i;
	for(int ip =0;ip < p.size();ip++){
		int pr = p[ip];
		while(ii%pr == 0){
			pri[i][ip]++;
			ii/=pr;
		}
	}
}

int ac(int i){
	int c = 0;
	for(int a=0;a<21;a++){
		if((pri[i][a]&1))
			c ^= (1<<a);
	}
	return c;
}

int main (){
	for(int a=2;a<=70;a++){
		if(mrk[a]) continue;
		p.pb(a);
		for(int b=a;b*a <= 70;b++){
			mrk[b*a] = 1;
		}
	}
	for(int a=1;a<=70;a++){
		f(a);
	}
	scanf("%d", &n);
	for(int a=0;a<n;a++){
		scanf("%d", &s[a]);
		int bm = ac(s[a]);
		qtd[bm]++;
	}
	pot[0] =1;
	for(int a=1;a<=n;a++){
		pot[a] = mod(2ll*pot[a-1]);
	}
	int t = 0;
	cnt[0][0] = 1;
	for(int i=0;i<=70;i++){
		if(qtd[i] == 0) continue;
		int bm = i;
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = 0;
		for(int a=0;a<BIT;a++){
			if(cnt[t][a] != 0){
				cnt[t][a] = mod(cnt[t][a]*pot[qtd[i]-1]);
				cnt[t^1][a^bm] = mod(cnt[t^1][a^bm] + cnt[t][a]);
			}
		}
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = mod(cnt[t^1][a] + cnt[t][a]);
		/*for(int a=0;a<10;a++)
			debug("%d ", cnt[t^1][a]);
		debug("\n");*/
		t = t^1;
	}
	printf("%lld\n", mod(modn + mod(cnt[(t&1)][0]-1)));
}


#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(stderr,args)
#else
#define debug(args...)
#endif //ONLINE_JUDGE
template<typename T> inline T abs(T t) { return t < 0? -t : t; }
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }

const int MAXN = 212345, BIT = (1<<21) + 10;

int n, m, k;

int s[MAXN];
int mrk[MAXN];

ll cnt[2][BIT];

ll qtd[73];

int pri[73][22];

ll pot[MAXN];

ll res;
vector<int> p;

void f(int i){
	int ii = i;
	for(int ip =0;ip < p.size();ip++){
		int pr = p[ip];
		while(ii%pr == 0){
			pri[i][ip]++;
			ii/=pr;
		}
	}
}

int ac(int i){
	int c = 0;
	for(int a=0;a<21;a++){
		if((pri[i][a]&1))
			c ^= (1<<a);
	}
	return c;
}

int main (){
	for(int a=2;a<=70;a++){
		if(mrk[a]) continue;
		p.pb(a);
		for(int b=a;b*a <= 70;b++){
			mrk[b*a] = 1;
		}
	}
	scanf("%d", &n);
	for(int a=0;a<n;a++){
		scanf("%d", &s[a]);
		qtd[s[a]]++;
	}
	pot[0] =1;
	for(int a=1;a<=n;a++){
		pot[a] = mod(2ll*pot[a-1]);
	}
	for(int a=1;a<=70;a++){
		f(a);
	}
	int t = 0;
	cnt[0][0] = 1;
	for(int i=1;i<=70;i++){
		if(qtd[i] == 0) continue;
		int bm = ac(i);
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = 0;
		for(int a=0;a<BIT;a++){
			if(cnt[t][a] != 0)
				cnt[t][a] = mod(cnt[t][a]*pot[qtd[i]-1]);
				cnt[t^1][a^bm] = mod(cnt[t^1][a^bm] + cnt[t][a]);
		}
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = mod(cnt[t^1][a] + cnt[t][a]);
		/*for(int a=0;a<10;a++)
			debug("%d ", cnt[t^1][a]);
		debug("\n");*/
		t = t^1;
	}
	printf("%lld\n", mod(modn + mod(cnt[(t&1)][0]-1)));
}


#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(stderr,args)
#else
#define debug(args...)
#endif //ONLINE_JUDGE
template<typename T> inline T abs(T t) { return t < 0? -t : t; }
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }

const int MAXN = 212345, BIT = (1<<21) + 10;

int n, m, k;

int s[MAXN];
int mrk[MAXN];

ll cnt[2][BIT];

ll qtd[73];

int pri[73][22];

ll pot[MAXN];

ll res;
vector<int> p;

void f(int i){
	int ii = i;
	for(int ip =0;ip < p.size();ip++){
		int pr = p[ip];
		while(ii%pr == 0){
			pri[i][ip]++;
			ii/=pr;
		}
	}
}

int ac(int i){
	int c = 0;
	for(int a=0;a<21;a++){
		if((pri[i][a]&1))
			c ^= (1<<a);
	}
	return c;
}

int main (){
	for(int a=2;a<=70;a++){
		if(mrk[a]) continue;
		p.pb(a);
		for(int b=a;b*a <= 70;b++){
			mrk[b*a] = 1;
		}
	}
	for(int a=1;a<=70;a++){
		f(a);
	}
	scanf("%d", &n);
	for(int a=0;a<n;a++){
		scanf("%d", &s[a]);
		int bm = ac(s[a]);
		qtd[bm]++;
	}
	pot[0] =1;
	for(int a=1;a<=n;a++){
		pot[a] = mod(2ll*pot[a-1]);
	}
	int t = 0;
	cnt[0][0] = 1;
	for(int i=0;i<=70;i++){
		if(qtd[i] == 0) continue;
		int bm = i;
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = 0;
		for(int a=0;a<BIT;a++){
			if(cnt[t][a] != 0){
				ll old = cnt[t][a];
				ll old2 = cnt[t^1][a^bm];
				cnt[t][a] = mod(old2 + cnt[t][a]*pot[qtd[i]-1]);
				cnt[t^1][a^bm] = mod(cnt[t^1][a^bm] + old*pot[qtd[i]-1]);
			}
		}
		for(int a=0;a<BIT;a++)
			cnt[t^1][a] = mod(cnt[t^1][a] + cnt[t][a]);
		/*for(int a=0;a<10;a++)
			debug("%d ", cnt[t^1][a]);
		debug("\n");*/
		t = t^1;
	}
	printf("%lld\n", mod(modn + mod(cnt[(t&1)][0]-1)));
}


#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define LC(x) (x<<1)
#define RC(x) ((x<<1)+1)
#define MID(x,y) ((x+y)>>1)
#define fin(name) freopen(name,"r",stdin)
#define fout(name) freopen(name,"w",stdout)
#define CLR(arr,val) memset(arr,val,sizeof(arr))
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);
typedef pair<int, int> pii;
typedef long long LL;
const double PI = acos(-1.0);
const int N = 1e5 + 7;
const LL mod = 1e9 + 7;
int st[N], cnt[71], POW[N];
LL dp[2][(1 << 19) + 10];
vector<int>P;

inline bool prime(int x)
{
	for (int i = 2; i * i <= x; ++i)
		if (x % i == 0)
			return 0;
	return 1;
}
int main(void)
{
	int n, i, j;
	for (i = 2; i <= 70; ++i)
		if (prime(i))
			P.push_back(i);
	POW[0] = 1;
	for (i = 1; i < N; ++i)
		POW[i] = POW[i - 1] * 2LL % mod;
	scanf("%d", &n);
	for (i = 1; i <= n; ++i)
	{
		int x;
		scanf("%d", &x);
		++cnt[x];
		for (j = 0; j < 19; ++j)
		{
			if (x % P[j] == 0)
			{
				int up = 0;
				while (x % P[j] == 0)
				{
					++up;
					x /= P[j];
				}
				if (up & 1)
					st[i] |= (1 << j);
			}
		}
	}
	for (i = 1; i <= 70; ++i)
	{
		int x = i;
		for (j = 0; j < 19; ++j)
		{
			if (x % P[j] == 0)
			{
				int up = 0;
				while (x % P[j] == 0)
				{
					++up;
					x /= P[j];
				}
				if (up & 1)
					st[i] |= (1 << j);
			}
		}
	}
	dp[0][0] = 1LL;
	int pre = 0, cur = 1;
	for (i = 1; i <= 70; ++i)
	{
		CLR(dp[cur], 0);
		if (!cnt[i])
		{
			for (j = 0; j < (1 << 19); ++j)
				dp[cur][j] = dp[pre][j];
		}
		else
		{
			for (j = 0; j < (1 << 19); ++j)
			{
				dp[cur][j ^ st[i]] = (dp[cur][j ^ st[i]] + dp[pre][j] * POW[cnt[i] - 1] % mod) % mod;
				dp[cur][j] = (dp[cur][j] + dp[pre][j] * POW[cnt[i] - 1] % mod) % mod;
			}
		}
		swap(cur, pre);
	}
	printf("%d\n", (dp[pre][0] - 1LL + mod) % mod);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define LC(x) (x<<1)
#define RC(x) ((x<<1)+1)
#define MID(x,y) ((x+y)>>1)
#define fin(name) freopen(name,"r",stdin)
#define fout(name) freopen(name,"w",stdout)
#define CLR(arr,val) memset(arr,val,sizeof(arr))
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);
typedef pair<int, int> pii;
typedef long long LL;
const double PI = acos(-1.0);
const int N = 1e5 + 7;
const LL mod = 1e9 + 7;
int arr[N], st[N], cnt[N], POW[N];
LL dp[2][1 << 19];
vector<int>P;

inline bool prime(int x)
{
    for(int i = 2; i * i <= x; ++i)
        if(x % i == 0)
            return 0;
    return 1;
}
inline LL mul(LL a, LL b)
{
    LL r = 0;
    while(b)
    {
        if(b & 1)
            r = (r + a) % mod;
        a = (a + a) % mod;
        b >>= 1;
    }
    return r;
}
int main(void)
{
    int n, i, j;
    for(i = 2; i <= 70; ++i)
        if(prime(i))
            P.push_back(i);
    POW[0] = 1;
    for(i = 1; i < N; ++i)
        POW[i] = POW[i - 1] * 2LL % mod;
    cin >> n;
    for(i = 1; i <= n; ++i)
    {
        cin >> arr[i];
        ++cnt[arr[i]];
        for(j = 0; j < 19; ++j)
        {
            if(arr[i] % P[j] == 0)
            {
                int up = 0;
                while(arr[i] % P[j] == 0)
                {
                    ++up;
                    arr[i] /= P[j];
                }
                if(up & 1)
                    st[i] |= (1 << j);
            }
        }
    }
    for(i = 1; i <= 70; ++i)
    {
        int x = i;
        for(j = 0; j < 19; ++j)
        {
            if(x % P[j] == 0)
            {
                int up = 0;
                while(x % P[j] == 0)
                {
                    ++up;
                    x /= P[j];
                }
                if(up & 1)
                    st[i] |= (1 << j);
            }
        }
    }
    dp[0][0] = 1LL;
    int cur = 0, nxt = 1;
    for(i = 1; i <= 70; ++i)
    {
        CLR(dp[nxt], 0);
        if(!cnt[i])
        {
            for(j = 0; j < (1 << 19); ++j)
                dp[nxt][j] = dp[cur][j];
        }
        else
        {
            for(j = 0; j < (1 << 19); ++j)
            {
                dp[nxt][j ^ st[i]] = (dp[nxt][j ^ st[i]] + mul(dp[cur][j], POW[cnt[i] - 1])) % mod;
                dp[nxt][j] = (dp[nxt][j] + mul(dp[cur][j], POW[cnt[i] - 1])) % mod;
            }
        }
        swap(nxt, cur);
    }
    cout << (dp[cur][0] - 1LL + mod) % mod << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define LC(x) (x<<1)
#define RC(x) ((x<<1)+1)
#define MID(x,y) ((x+y)>>1)
#define fin(name) freopen(name,"r",stdin)
#define fout(name) freopen(name,"w",stdout)
#define CLR(arr,val) memset(arr,val,sizeof(arr))
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);
typedef pair<int, int> pii;
typedef long long LL;
const double PI = acos(-1.0);
const int N = 1e5 + 7;
const LL mod = 1e9 + 7;
int st[N], cnt[71], POW[N];
LL dp[2][(1 << 19) + 10];
vector<int>P;

inline bool prime(int x)
{
	for (int i = 2; i * i <= x; ++i)
		if (x % i == 0)
			return 0;
	return 1;
}
int main(void)
{
	int n, i, j;
	for (i = 2; i <= 70; ++i)
		if (prime(i))
			P.push_back(i);
	POW[0] = 1;
	for (i = 1; i < N; ++i)
		POW[i] = POW[i - 1] * 2LL % mod;
	scanf("%d", &n);
	for (i = 1; i <= n; ++i)
	{
		int x;
		scanf("%d", &x);
		++cnt[x];
		for (j = 0; j < 19; ++j)
		{
			if (x % P[j] == 0)
			{
				int up = 0;
				while (x % P[j] == 0)
				{
					++up;
					x /= P[j];
				}
				if (up & 1)
					st[i] |= (1 << j);
			}
		}
	}
	for (i = 1; i <= 70; ++i)
	{
		int x = i;
		for (j = 0; j < 19; ++j)
		{
			if (x % P[j] == 0)
			{
				int up = 0;
				while (x % P[j] == 0)
				{
					++up;
					x /= P[j];
				}
				if (up & 1)
					st[i] |= (1 << j);
			}
		}
	}
	dp[0][0] = 1LL;
	int pre = 0, cur = 1;
	for (i = 1; i <= 70; ++i)
	{
		CLR(dp[cur], 0);
		if (!cnt[i])
		{
			for (j = 0; j < (1 << 19); ++j)
				dp[cur][j] = dp[pre][j];
		}
		else
		{
			for (j = 0; j < (1 << 19); ++j)
			{
				dp[cur][j ^ st[i]] = (dp[cur][j ^ st[i]] + dp[pre][j] * POW[cnt[i] - 1] % mod) % mod;
				dp[cur][j] = (dp[cur][j] + dp[pre][j] * POW[cnt[i] - 1] % mod) % mod;
			}
		}
		swap(cur, pre);
	}
	printf("%I64d\n", (dp[pre][0] - 1LL + mod) % mod);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define LC(x) (x<<1)
#define RC(x) ((x<<1)+1)
#define MID(x,y) ((x+y)>>1)
#define fin(name) freopen(name,"r",stdin)
#define fout(name) freopen(name,"w",stdout)
#define CLR(arr,val) memset(arr,val,sizeof(arr))
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);
typedef pair<int, int> pii;
typedef long long LL;
const double PI = acos(-1.0);
const int N = 1e5 + 7;
int arr[N], bit[N], st[N];
vector<int>P;

int ins(LL x)
{
    for(int i = 19; i >= 0; --i)
    {
        if(x & (1LL << i))
        {
            if(!bit[i])
            {
                bit[i] = x;
                break;
            }
            else
                x ^= bit[i];
        }
    }
    return x != 0;
}
inline int prime(int x)
{
    for(int i = 2; i * i <= x; ++i)
        if(x % i == 0)
            return 0;
    return 1;
}
int main(void)
{
    int n, i, j;
    for(i = 2; i <= 70; ++i)
        if(prime(i))
            P.push_back(i);
    cin >> n;
    int t = 0;
    for(i = 1; i <= n; ++i)
    {
        cin >> arr[i];
        for(j = 0; j < 19; ++j)
        {
            if(arr[i] % P[j] == 0)
            {
                int up = 0;
                while(arr[i] % P[j] == 0)
                {
                    ++up;
                    arr[i] /= P[j];
                }
                if(up & 1)
                    st[i] |= (1 << j);
            }
        }
        if(!ins(st[i]))
            ++t;
    }
    cout << (1 << t) - 1 << endl;
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>

using namespace std;

#define LL long long
const int INF = 0x3f3f3f3f;
#define MAXN 60100
#define MAXM 1000100

const LL mod = 1e9 + 7;
int s[100],cnt[100];
int pri[19] = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67 };
int dp[71][1 << 19];
int a[100005];

int main()
{
	int n, x;
	for (int i = 2; i <= 70; i++)
	{
		int x = i;
		for (int j = 0; j < 19; j++)
		{
			while (x%pri[j] == 0) s[i] ^= (1 << j), x /= pri[j];
		}
	}
	a[0] = 1;
	for (int i = 1; i <= 100004; i++)
		a[i] = (2 * a[i - 1]) % mod;
	while (~scanf("%d", &n))
	{
		memset(cnt, 0, sizeof cnt);
		memset(dp, 0, sizeof dp);
		for (int i = 0; i < n; i++)
		{
			scanf("%d", &x);
			cnt[x]++;
		}
		dp[0][0] = 1;
		for (int i = 1; i <= 70; i++)
		{
			if (cnt[i] == 0)
			{
				for (int j = 0; j < (1 << 19); j++)
					dp[i][j] = dp[i - 1][j];
				continue;
			}
			for (int j = 0; j < (1 << 19); j++)
			{
				dp[i][j^s[i]] = 1LL * (1LL*dp[i][j^s[i]] + 1LL*dp[i - 1][j] * a[cnt[i] - 1]) % mod;
				dp[i][j] = 1LL * (1LL*dp[i][j] + 1LL*dp[i - 1][j] * a[cnt[i] - 1]) % mod;
			}
		}
		printf("%d\n", (dp[70][0] - 1 + mod) % mod);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define LC(x) (x<<1)
#define RC(x) ((x<<1)+1)
#define MID(x,y) ((x+y)>>1)
#define fin(name) freopen(name,"r",stdin)
#define fout(name) freopen(name,"w",stdout)
#define CLR(arr,val) memset(arr,val,sizeof(arr))
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);
typedef pair<int, int> pii;
typedef long long LL;
const double PI = acos(-1.0);
const int N = 1e5 + 7;
const LL mod = 1e9 + 7;
int arr[N], bit[N], st[N];
vector<int>P;

int ins(LL x)
{
    for(int i = 18; i >= 0; --i)
    {
        if(x & (1LL << i))
        {
            if(!bit[i])
            {
                bit[i] = x;
                break;
            }
            else
                x ^= bit[i];
        }
    }
    return x != 0;
}
inline int prime(int x)
{
    for(int i = 2; i * i <= x; ++i)
        if(x % i == 0)
            return 0;
    return 1;
}
inline LL qpow(LL a, LL b)
{
    LL r = 1;
    while(b)
    {
        if(b & 1)
            r =  r * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return r;
}
int main(void)
{
    int n, i, j;
    for(i = 2; i <= 70; ++i)
        if(prime(i))
            P.push_back(i);
    cin >> n;
    int t = 0;
    for(i = 1; i <= n; ++i)
    {
        cin >> arr[i];
        for(j = 0; j < 19; ++j)
        {
            if(arr[i] % P[j] == 0)
            {
                int up = 0;
                while(arr[i] % P[j] == 0)
                {
                    ++up;
                    arr[i] /= P[j];
                }
                if(up & 1)
                    st[i] |= (1 << j);
            }
        }
        if(!ins(st[i]))
            ++t;
    }
    cout << (qpow(2LL, (LL)t) - 1LL + mod) % mod << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define LC(x) (x<<1)
#define RC(x) ((x<<1)+1)
#define MID(x,y) ((x+y)>>1)
#define fin(name) freopen(name,"r",stdin)
#define fout(name) freopen(name,"w",stdout)
#define CLR(arr,val) memset(arr,val,sizeof(arr))
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);
typedef pair<int, int> pii;
typedef long long LL;
const double PI = acos(-1.0);
const int N = 1e5 + 7;
const LL mod = 1e9 + 7;
int arr[N], st[N], cnt[N], POW[N];
LL dp[75][1 << 19];
vector<int>P;

inline bool prime(int x)
{
    for(int i = 2; i * i <= x; ++i)
        if(x % i == 0)
            return 0;
    return 1;
}
inline LL mul(LL a, LL b)
{
    LL r = 0;
    while(b)
    {
        if(b & 1)
            r = (r + a) % mod;
        a = (a + a) % mod;
        b >>= 1;
    }
    return r;
}
int main(void)
{
    int n, i, j;
    for(i = 2; i <= 70; ++i)
        if(prime(i))
            P.push_back(i);
    POW[0] = 1;
    for(i = 1; i < N; ++i)
        POW[i] = POW[i - 1] * 2LL % mod;
    cin >> n;
    for(i = 1; i <= n; ++i)
    {
        cin >> arr[i];
        ++cnt[arr[i]];
        for(j = 0; j < 19; ++j)
        {
            if(arr[i] % P[j] == 0)
            {
                int up = 0;
                while(arr[i] % P[j] == 0)
                {
                    ++up;
                    arr[i] /= P[j];
                }
                if(up & 1)
                    st[i] |= (1 << j);
            }
        }
    }
    dp[0][0] = 1;
    for(i = 1; i <= 70; ++i)
    {
        if(cnt[i] == 0)
        {
            for(int j = 0; j < (1 << 19); ++j)
                dp[i][j] = dp[i - 1][j];
        }
        else
        {
            for(int j = 0; j < (1 << 19); ++j)
            {
                dp[i][j ^ st[i]] = (dp[i][j ^ st[i]] + mul(dp[i - 1][j], POW[cnt[i] - 1])) % mod;
                dp[i][j] = (dp[i][j] + mul(dp[i - 1][j], POW[cnt[i] - 1])) % mod;
            }
        }
    }
    cout << (dp[70][0] - 1LL + mod) % mod << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define LC(x) (x<<1)
#define RC(x) ((x<<1)+1)
#define MID(x,y) ((x+y)>>1)
#define fin(name) freopen(name,"r",stdin)
#define fout(name) freopen(name,"w",stdout)
#define CLR(arr,val) memset(arr,val,sizeof(arr))
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);
typedef pair<int, int> pii;
typedef long long LL;
const double PI = acos(-1.0);
const int N = 1e5 + 7;
const LL mod = 1e9 + 7;
int arr[N], st[N], cnt[N], POW[N];
int dp[2][1 << 19];
vector<int>P;

inline bool prime(int x)
{
    for(int i = 2; i * i <= x; ++i)
        if(x % i == 0)
            return 0;
    return 1;
}
int main(void)
{
    int n, i, j;
    for(i = 2; i <= 70; ++i)
        if(prime(i))
            P.push_back(i);
    POW[0] = 1;
    for(i = 1; i < N; ++i)
        POW[i] = POW[i - 1] * 2LL % mod;
    scanf("%d", &n);
    for(i = 1; i <= n; ++i)
    {
        scanf("%d", &arr[i]);
        ++cnt[arr[i]];
        for(j = 0; j < 19; ++j)
        {
            if(arr[i] % P[j] == 0)
            {
                int up = 0;
                while(arr[i] % P[j] == 0)
                {
                    ++up;
                    arr[i] /= P[j];
                }
                if(up & 1)
                    st[i] |= (1 << j);
            }
        }
    }
    for(i = 1; i <= 70; ++i)
    {
        int x = i;
        for(j = 0; j < 19; ++j)
        {
            if(x % P[j] == 0)
            {
                int up = 0;
                while(x % P[j] == 0)
                {
                    ++up;
                    x /= P[j];
                }
                if(up & 1)
                    st[i] |= (1 << j);
            }
        }
    }
    dp[0][0] = 1LL;
    int cur = 0, nxt = 1;
    for(i = 1; i <= 70; ++i)
    {
        CLR(dp[nxt], 0);
        if(!cnt[i])
        {
            for(j = 0; j < (1 << 19); ++j)
                dp[nxt][j] = dp[cur][j];
        }
        else
        {
            for(j = 0; j < (1 << 19); ++j)
            {
                dp[nxt][j ^ st[i]] = (1LL * dp[nxt][j ^ st[i]] + 1LL * dp[cur][j] * 1LL * POW[cnt[i] - 1]) % mod;
                dp[nxt][j] = (1LL * dp[nxt][j] + 1LL * dp[cur][j] * 1LL * POW[cnt[i] - 1]) % mod;
            }
        }
        swap(nxt, cur);
    }
    printf("%d\n", (dp[cur][0] - 1LL + mod) % mod);
    return 0;
}