#include <bits/stdc++.h>
using namespace std;
const int N = 100005, mod = 1e9 + 7;
int mu[N], pow2[N];
int n, a[N], f[N];
void solve() {
  int ans = 0;
  for (int i = 1; i <= 100000; i++)
    if (mu[i]) ans = (ans + mu[i] * (pow2[f[i]] - 1)) % mod;
  ans = (ans + mod) % mod;
  printf("%d\n", ans);
}
void init() {
  pow2[0] = 1;
  for (int i = 1; i <= 100000; i++) pow2[i] = pow2[i - 1] * 2 % mod;
  static bool p[N];
  static int prime[N], cnt = 0;
  memset(p, 1, sizeof p);
  mu[1] = 1;
  for (int i = 2; i <= 100000; i++) {
    if (p[i]) mu[i] = -1, prime[++cnt] = i;
    for (int j = 1; j <= cnt && i * prime[j] <= 100000; j++) {
      p[i * prime[j]] = 0;
      if (i % prime[j])
        mu[i * prime[j]] = mu[i] * mu[prime[j]];
      else
        break;
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j * j <= a[i]; j++)
      if (a[i] % j == 0) {
        f[j]++;
        if (j != a[i] / j) f[a[i] / j]++;
      }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  init();
  solve();
  return 0;
}
