#include <bits/stdc++.h>
using namespace std;
int x, i, j, k, n, m, f[100010], S, Ma, Ans, mu[100010], p[100010], Cnt;
bool b[100010];
inline int Max(int x, int y) { return x < y ? y : x; }
inline int Pow(int x, int y) {
  if (y == 0) return 1;
  int Ans = Pow(x, y >> 1);
  Ans = 1ll * Ans * Ans % 1000000007;
  if (y & 1) return 1ll * Ans * x % 1000000007;
  return Ans;
}
inline void Init() {
  mu[1] = 1;
  for (i = 2; i <= Ma; i++) {
    if (!b[i]) p[++Cnt] = i, mu[i] = -1;
    for (j = 1; j <= Cnt && p[j] * i <= Ma; j++) {
      b[p[j] * i] = 1;
      if (!(i % p[j])) break;
      mu[p[j] * i] = -mu[i];
    }
  }
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    Ma = Max(Ma, x);
    S = sqrt(x);
    for (j = 1; j <= S; j++)
      if (x % j == 0) {
        f[j]++;
        if (j * j < x) f[x / j]++;
      }
  }
  Init();
  for (i = 1; i <= Ma; i++)
    Ans = (Ans + (Pow(2, f[i]) - 1) * mu[i]) % 1000000007;
  printf("%d\n", (Ans + 1000000007) % 1000000007);
  return 0;
}
