#include <bits/stdc++.h>
const int MAXN = 100001;
const int mod = 1e9 + 7;
int miu[MAXN], prime[MAXN], tot, P[MAXN], cnt[MAXN], d[MAXN];
bool vis[MAXN];
void init() {
  int i, j;
  miu[1] = 1;
  for (i = 2; i < MAXN; ++i) {
    if (!vis[i]) prime[tot++] = i, miu[i] = -1;
    for (j = 0; j < tot && i * prime[j] < MAXN; ++j) {
      vis[i * prime[j]] = 1;
      if (i % prime[j])
        miu[i * prime[j]] = miu[i] * -1;
      else
        break;
    }
  }
  P[1] = 1;
  for (i = 2; i < MAXN; i++) P[i] = ((P[i - 1] << 1) + 1) % mod;
}
int main() {
  init();
  int N, M = 0, x, i, j, ans = 0;
  scanf("%d", &N);
  for (i = 0; i < N; ++i) {
    scanf("%d", &x);
    ++d[x];
    M = ((M) > (x) ? (M) : (x));
  }
  for (i = 1; i <= M; ++i)
    for (j = i; j <= M; j += i) cnt[i] += d[j];
  for (i = 1; i <= M; ++i) ans = (ans + miu[i] * P[cnt[i]]) % mod;
  printf("%d\n", (ans + mod) % mod);
}
