#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100007, MOD = 1e9 + 7;
int n, occ[MAXN], min_div[MAXN] = {}, p2[MAXN], lim = 0;
void sieve() {
  for (int i = 2; i <= lim; ++i)
    if (!min_div[i]) {
      min_div[i] = i;
      for (int j = i + i; j <= lim; j += i)
        if (!min_div[j]) min_div[j] = i;
    }
}
int sum(int a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
  return a;
}
int sub(int a, int b) {
  a -= b;
  if (a < 0) a += MOD;
  return a;
}
int no_emp(int n) {
  int ret = p2[n];
  --ret;
  if (ret < 0) ret += MOD;
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  p2[0] = 1;
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x, ++occ[x], lim = max(lim, x);
    p2[i] = 2LL * p2[i - 1] % MOD;
  }
  sieve();
  int res = no_emp(n);
  for (int i = 2; i <= lim; ++i) {
    bool ok = 1;
    int t = i, cnt = 0;
    while (t > 1) {
      if (min_div[t / min_div[t]] == min_div[t]) {
        ok = 0;
        break;
      }
      t /= min_div[t], ++cnt;
    }
    if (ok) {
      int num = 0;
      for (int j = i; j <= lim; j += i) num += occ[j];
      if (cnt & 1)
        res = sub(res, no_emp(num));
      else
        res = sum(res, no_emp(num));
    }
  }
  cout << res;
  return 0;
}
