#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> primes, nums, factors, powers;
vector<vector<int> > memo;
const int MOD = 1e9 + 7;
void sieve(int n) {
  vector<bool> is_prime(n + 1, true);
  int limit = floor(sqrt(n));
  for (int i = 2; i < (int)limit + 1; i++)
    if (is_prime[i])
      for (int j = i * i; j <= n; j += i) is_prime[j] = false;
  for (int i = 2; i < (int)n + 1; i++)
    if (is_prime[i]) primes.push_back(i);
}
int factor(int num) {
  int b = 0;
  for (int i = 0; i < (int)primes.size(); i++) {
    int p = primes[i];
    while (num % p == 0) {
      b ^= (1 << i);
      num /= p;
    }
  }
  return b;
}
int f(int i, int b) {
  if (i == 0 and b == 0) return 1;
  if (i == 0) return 0;
  if (memo[i][b] != -1) return memo[i][b];
  if (nums[i] == 0) return memo[i][b] = f(i - 1, b);
  return memo[i][b] =
             ((long long)powers[nums[i] - 1] * f(i - 1, b) +
              (long long)powers[nums[i] - 1] * f(i - 1, b ^ factors[i])) %
             MOD;
}
int main() {
  sieve(70);
  cin >> N;
  memo.assign(71, vector<int>((1 << 19), -1));
  nums.assign(71, 0);
  powers.assign(1e5, -1);
  factors.assign(71, -1);
  powers[0] = 1;
  for (int i = 1; i < (int)N; i++) powers[i] = (2 * powers[i - 1]) % MOD;
  for (int i = 0; i < (int)N; i++) {
    int num;
    cin >> num;
    nums[num]++;
    if (nums[num] == 1) factors[num] = factor(num);
  }
  cout << f(70, 0) - 1 << '\n';
}
