#include <bits/stdc++.h>
using namespace std;
const int lim = 100000;
int prime[100005], mu[100005];
char vis[100005];
int n;
int a[100005];
int qr(int x, int y) {
  int t = 1;
  for (; y; y >>= 1, x = 1LL * x * x % 1000000007)
    if (y & 1) t = 1LL * t * x % 1000000007;
  return t;
}
void init() {
  mu[1] = 1;
  for (int i = 2; i <= lim; ++i) {
    if (!vis[i]) prime[++prime[0]] = i, mu[i] = -1;
    for (int j = 1; prime[j] * i <= lim && j <= prime[0]; ++j) {
      vis[i * prime[j]] = 1;
      if (i % prime[j])
        mu[i * prime[j]] = -mu[i];
      else
        break;
    }
  }
}
int main() {
  init();
  scanf("%d", &n);
  for (int x, i = 1; i <= n; ++i) scanf("%d", &x), ++a[x];
  int ans = 0;
  for (int i = 1; i <= lim; ++i)
    if (mu[i]) {
      int t = 0;
      for (int j = i; j <= lim; j += i) t += a[j];
      if (!t) continue;
      ans += mu[i] * (qr(2, t) - 1);
      ans %= 1000000007;
    }
  if (ans < 0) ans += 1000000007;
  printf("%d\n", ans);
}
