#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
int mu[maxn];
int prime[maxn];
bool vis[maxn];
int f[maxn];
inline int add(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline int dec(int a, int b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
inline int mul(int a, int b) { return 1ll * a * b % mod; }
inline int mul(int a, int b, int c) { return 1ll * a * b % mod * c % mod; }
void initial(const int n = 1e5) {
  mu[1] = 1;
  int cnt = 0;
  for (int i = 2; i <= n; i++) {
    if (vis[i] == false) {
      prime[++cnt] = i;
      mu[i] = -1;
    }
    for (int j = 1; j <= cnt && i * prime[j] <= n; j++) {
      int k = i * prime[j];
      vis[k] = true;
      if (i % prime[j] == 0) {
        mu[k] = 0;
        break;
      } else {
        mu[k] = -mu[i];
      }
    }
  }
}
void work(int x) {
  for (int i = 1; 1ll * i * i <= x; i++) {
    if (x % i) continue;
    f[i]++;
    if (1ll * i * i != x) f[x / i]++;
  }
}
int _pow(int a, int n, int mod) {
  int res = 1;
  while (n) {
    if (n & 1) res = mul(res, a);
    a = mul(a, a);
    n >>= 1;
  }
  return res;
}
int calc(int x) { return dec(_pow(2, x, mod), 1); }
int main(void) {
  initial();
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    work(x);
  }
  int res = 0;
  for (int i = 1; i <= 100000; i++) {
    if (mu[i] == 0) continue;
    if (mu[i] == 1) res = add(res, calc(f[i]));
    if (mu[i] == -1) res = dec(res, calc(f[i]));
  }
  printf("%d\n", res);
  return 0;
}
