#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
template <class T>
void mxi(T& a, const T& b) {
  a = max(a, b);
}
template <class T>
void mni(T& a, const T& b) {
  a = min(a, b);
}
long double EPS = 1e-9;
mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count());
const int p70[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
                   31, 37, 41, 43, 47, 53, 59, 61, 67};
int bexp(int a, int n) {
  if (n == 0) return 1;
  int k = bexp(a, n >> 1);
  k = (1LL * k * k) % 1000000007;
  if (n & 1) k = (1LL * a * k) % 1000000007;
  return k;
}
int rnk, basis[21];
void InsertVector(int e) {
  for (int i = 0; i < 21; i++) {
    if (e & (1 << i)) {
      if (!basis[i]) {
        basis[i] = e;
        rnk++;
        return;
      }
      e ^= basis[i];
    }
  }
}
void solve() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    int candidate_vector = 0;
    for (int j = 0; j < 19; j++) {
      int cnt = 0;
      while ((x % p70[j]) == 0) {
        x /= p70[j];
        ++cnt;
      }
      if (cnt & 1) candidate_vector |= (1 << j);
    }
    InsertVector(candidate_vector);
  }
  cout << (bexp(2, n - rnk) - 1 + 1000000007) % 1000000007 << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t, tab;
  t = 1;
  tab = t;
  while (t--) {
    solve();
  }
  cerr << ((double)clock() / CLOCKS_PER_SEC);
}
