#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << "\n";
  err(++it, args...);
}
const int MOD = 1e9 + 7, N = 70, NP = 19;
int p[] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29,
           31, 37, 41, 43, 47, 53, 59, 61, 67};
vector<int> mask(N + 5, 0);
int dp[N + 5][1 << NP], po[N + 5][2];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    ;
    for (int i = 1; i < N + 1; i++) {
      po[i][0] = 1;
      po[i][1] = 0;
    }
    for (int i = 0; i < n; i++) {
      int val = po[a[i]][0];
      po[a[i]][0] = (po[a[i]][0] + po[a[i]][1]) % MOD;
      po[a[i]][1] = (po[a[i]][1] + val) % MOD;
    }
    for (int i = 1; i < N + 1; i++) {
      for (int j = 0; j < NP; j++) {
        int cnt = 0, ti = i;
        while (ti % p[j] == 0) {
          cnt++;
          ti /= p[j];
        }
        if (cnt % 2 != 0) {
          mask[i] |= (1 << j);
        }
      }
    }
    int mxmask = (1 << NP);
    dp[0][0] = 1;
    for (int i = 1; i < N + 1; i++) {
      for (int j = 0; j < mxmask; j++) {
        dp[i][j] = ((dp[i - 1][j] * (long long)1 * po[i][0]) % MOD +
                    (dp[i - 1][j ^ mask[i]] * (long long)1 * po[i][1]) % MOD) %
                   MOD;
      }
    }
    cout << ((dp[N][0] - 1 + MOD) % MOD) << "\n";
  }
}
