#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
long long mod = 1000000007LL;
long long mod2 = 998244353LL;
int t;
int n, x, k;
int a[100005];
bool pr[100];
int cnt[100], st[100];
int dp[71][(1 << 19)];
int pw[100005];
int main() {
  memset(pr, true, sizeof(pr));
  vector<int> ps;
  ps.clear();
  for (int i = 2; i <= 70; ++i) {
    if (pr[i]) {
      ps.push_back(i);
      for (int j = 2 * i; j <= 70; j += i) {
        pr[j] = false;
      }
    }
  }
  memset(cnt, 0, sizeof(cnt));
  memset(st, 0, sizeof(st));
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    cnt[a[i]]++;
  }
  pw[0] = 1;
  for (int i = 1; i <= n; ++i) {
    pw[i] = (int)((long long)pw[i - 1] * 2LL % mod);
  }
  for (int i = 1; i <= 70; ++i) {
    int x = i;
    for (int j = 0; j < ps.size(); ++j) {
      int num = 0;
      while (x % ps[j] == 0) {
        num++;
        x /= ps[j];
      }
      if (num % 2) st[i] |= (1 << j);
    }
  }
  dp[0][0] = 1;
  int sz = (int)ps.size();
  for (int i = 0; i < 70; ++i) {
    for (int j = 0; j < (1 << sz); ++j) {
      if (cnt[i + 1] > 0) {
        dp[i + 1][j] =
            (int)((dp[i + 1][j] +
                   (long long)dp[i][j] * (long long)pw[cnt[i + 1] - 1] % mod) %
                  mod);
        dp[i + 1][j ^ st[i + 1]] =
            (int)((dp[i + 1][j ^ st[i + 1]] +
                   (long long)dp[i][j] * (long long)pw[cnt[i + 1] - 1] % mod) %
                  mod);
      } else {
        dp[i + 1][j] = (int)((dp[i + 1][j] + dp[i][j]) % mod);
      }
    }
  }
  cout << (dp[70][0] - 1 + mod) % mod << endl;
  return 0;
}
