#include <bits/stdc++.h>
using namespace std;
int f[20], a[100010], n;
int ps[20] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
              31, 37, 41, 43, 47, 53, 59, 61, 67};
inline int g(int x) {
  int ret = 0;
  for (int i = 0; i < 19; i++)
    while (x % ps[i] == 0) {
      x /= ps[i];
      ret ^= (1 << i);
    }
  return ret;
}
void consider(int &x, int pos) {
  for (int i = 0; i < 20; i++)
    if (x & (1 << i)) {
      if (f[i])
        x ^= a[f[i]];
      else {
        f[i] = pos;
        return;
      }
    }
}
inline long long pwr(long long b, long long e) {
  b %= 1000000007;
  if (e == 0) return 1;
  if (e == 1) return b;
  return (pwr(b * b, e / 2) * pwr(b, e % 2)) % 1000000007;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] = g(a[i]);
    consider(a[i], i);
  }
  int res = pwr(2, n - count_if(f, f + 20, [](int x) { return x; }));
  cout << --res << endl;
  return 0;
}
