#include <bits/stdc++.h>
using namespace std;
long long a[600000], bb[602000], lp[600000], vs[600000], vs1[600000];
vector<long long> v;
long long f(long long n, long long b, long long mod) {
  long long aa, ans = 1;
  if (!b) return 1;
  if (b % 2) ans = n;
  aa = f(n, b / 2, mod);
  return ((aa * aa) % mod * ans) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  long long i, j, n, m, k, l, cnt = 0, h = 0, mod = 1e9 + 7, ans = 0;
  for (i = 2; i * i <= 1e5; i++) {
    if (!lp[i]) {
      for (j = i * i; j <= 1e5; j += i)
        if (!lp[j]) lp[j] = i;
    }
  }
  for (i = 2; i <= 1e5; i++)
    if (!lp[i]) lp[i] = i;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    vs1[a[i]]++;
    h = max(h, a[i]);
  }
  for (i = 2; i <= h; i++) {
    j = i;
    cnt = 0;
    while (j != 1) {
      l = lp[j];
      j /= l;
      if (j % l == 0) {
        cnt = 0;
        break;
      }
      cnt++;
    }
    if (cnt) {
      vs[i] = cnt;
      v.push_back(i);
    }
  }
  for (i = 2; i <= h; i++) {
    if (vs[i]) {
      for (j = i; j <= h; j += i) bb[i] += vs1[j];
    }
  }
  for (i = 0; i < v.size(); i++) {
    if (vs[v[i]] % 2)
      ans = (ans + f(2, bb[v[i]], mod) - 1) % mod;
    else
      ans = (ans - f(2, bb[v[i]], mod) + 1) % mod;
  }
  cout << (f(2, n, mod) - 1 - ans + 2 * mod) % mod << endl;
  return 0;
}
