#include <bits/stdc++.h>
using namespace std;
int p[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
           31, 37, 41, 43, 47, 53, 59, 61, 67};
int n, a;
int b[100000 + 5], s[20];
void Insert(int x) {
  for (int i = 18; i >= 0; i--)
    if (x >> i & 1) {
      if (!s[i]) {
        s[i] = x;
        break;
      }
      x ^= s[i];
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a);
    for (int j = 0; j <= 18; j++)
      if (a % p[j] == 0) {
        int pn = 0;
        while (a % p[j] == 0) a /= p[j], pn ^= 1;
        b[i] |= (pn << j);
      }
    Insert(b[i]);
  }
  for (int i = 0; i <= 18; i++)
    if (s[i]) n--;
  int res = 1;
  for (int i = 1; i <= n; i++) res = (res * 2LL) % 1000000007;
  printf("%d", res - 1);
}
