#include <bits/stdc++.h>
using namespace std;
template <typename _T>
inline void _DBG(const char* s, _T x) {
  cerr << s << " = " << x << endl;
}
template <typename _T, typename... args>
void _DBG(const char* s, _T x, args... a) {
  while (*s != ',') cerr << *s++;
  cerr << " = " << x << ',';
  _DBG(s + 1, a...);
}
vector<int64_t> primes;
const int64_t MAXA = 71;
const int64_t MOD = 1000000007;
const int64_t MITM = 22;
void init() {
  vector<bool> used(MAXA);
  for (int64_t i = 2; i < MAXA; ++i) {
    if (!used[i]) {
      primes.push_back(i);
      for (int64_t j = 1; j * i < MAXA; ++j) {
        used[j * i] = true;
      }
    }
  }
}
int64_t fpow(int64_t a, int64_t n) {
  if (n == 0) {
    return 1;
  } else if (n % 2 == 1) {
    return (a * fpow(a, n - 1)) % MOD;
  } else {
    return fpow((a * a) % MOD, n / 2);
  }
}
int64_t get_mask(int64_t a) {
  int64_t res = 0;
  for (int64_t i = 0; i < primes.size(); ++i) {
    int64_t cur = primes[i], cnt = 0;
    while (a % cur == 0) {
      ++cnt;
      cur *= primes[i];
    }
    if (cnt % 2) {
      res += (1 << i);
    }
  }
  return res;
}
unordered_map<int64_t, int64_t> get_dp(unordered_map<int64_t, int64_t>& mp) {
  vector<pair<int64_t, int64_t> > mask_to_cnt;
  for (auto pr : mp) {
    mask_to_cnt.push_back(pr);
  }
  int64_t n = mask_to_cnt.size();
  int64_t sum = 0;
  for (auto pr : mask_to_cnt) {
    sum += pr.second;
  }
  unordered_map<int64_t, int64_t> res;
  for (int64_t mask = 0; mask < (1 << n); ++mask) {
    int64_t cur_res_mask = 0;
    for (int64_t i = 0; i < n; ++i) {
      if (mask & (1 << i)) {
        cur_res_mask = (cur_res_mask ^ mask_to_cnt[i].first);
      }
    }
    res[cur_res_mask] += fpow(2, sum - n);
    res[cur_res_mask] %= MOD;
  }
  return res;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  init();
  int64_t n;
  cin >> n;
  vector<int64_t> a(n);
  unordered_map<int64_t, int64_t> mask_to_cnt;
  for (int64_t i = 0; i < n; ++i) {
    cin >> a[i];
    ++mask_to_cnt[get_mask(a[i])];
  }
  unordered_map<int64_t, int64_t> mp1, mp2;
  int64_t tmp_cnt = 0;
  for (auto pr : mask_to_cnt) {
    if (tmp_cnt >= MITM) {
      mp2[pr.first] = pr.second;
    } else {
      mp1[pr.first] = pr.second;
    }
    ++tmp_cnt;
  }
  assert(mp1.size() <= 22);
  assert(mp1.size() <= 22);
  auto dp1 = get_dp(mp1);
  auto dp2 = get_dp(mp2);
  int64_t ans = 0;
  for (auto pr : dp1) {
    ans += pr.second * dp2[pr.first];
    ans %= MOD;
  }
  cout << ans - 1 << "\n";
  return 0;
}
