#include <bits/stdc++.h>
using namespace std;
int mu[100005], N, prime[100005], mark[100005], cnt[100005], mi[100005];
void shai() {
  int i, j;
  mu[1] = 1;
  for (i = 2; i < 100005; i++) {
    if (!mark[i]) {
      prime[++*prime] = i;
      mu[i] = -1;
    }
    for (j = 1; i * prime[j] < 100005; j++) {
      mark[i * prime[j]] = 1;
      if (i % prime[j] == 0) break;
      mu[i * prime[j]] = -mu[i];
    }
  }
}
void init() {
  int i, j, x;
  scanf("%d", &N);
  for (i = 1; i <= N; i++) {
    scanf("%d", &x);
    for (j = 1; j * j <= x; j++)
      if (x % j == 0) cnt[j]++, cnt[x / j] += j != x / j;
  }
  mi[0] = 1;
  for (i = 1; i < 100005; i++) mi[i] = (mi[i - 1] << 1) % 1000000007ll;
}
int main() {
  long long ans = 0;
  init();
  shai();
  for (int i = 1; i < 100005; i++)
    ans = (ans + (mi[cnt[i]] - 1) * mu[i]) % 1000000007ll;
  printf("%I64d", (ans + 1000000007ll) % 1000000007ll);
  return 0;
}
