#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int runs, p[100100], mu[100100];
bool vis[100100];
void get_mu() {
  mu[1] = 1;
  for (int i = 2; i < 100100; i++) {
    if (!vis[i]) mu[i] = -1, p[++runs] = i;
    for (int j = 1; j <= runs && i * p[j] < 100100; j++) {
      vis[i * p[j]] = 1;
      if (i % p[j] == 0) break;
      mu[i * p[j]] = -mu[i];
    }
  }
}
int expmod(int a, int b) {
  int rlt = 1, x = a;
  while (b) {
    if (b & 1) rlt = 1ll * rlt * x % mod;
    x = 1ll * x * x % mod, b >>= 1;
  }
  return rlt;
}
int n, x, cnt[100100];
int main() {
  get_mu();
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    for (int j = 1; j * j <= x; j++)
      if (x % j == 0) {
        cnt[j]++;
        if (j * j != x) cnt[x / j]++;
      }
  }
  int ans = 0;
  for (int i = 1; i <= 100000; i++)
    ans = (ans + (expmod(2, cnt[i]) - 1) * mu[i]) % mod;
  printf("%d\n", (ans + mod) % mod);
  return 0;
}
