#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
double PI = acos(-1);
double EPS = 1e-6;
int num;
bool v[100000];
int prime[100000 + 5], mu[100000 + 5];
void Moblus() {
  memset(v, false, sizeof(v));
  mu[1] = 1;
  int tot = 0;
  for (int i = 2; i <= 100000; i++) {
    if (!v[i]) {
      prime[tot++] = i;
      mu[i] = -1;
    }
    for (int j = 0; j < tot; j++) {
      if (i * prime[j] > 100000) break;
      v[i * prime[j]] = true;
      if (i % prime[j] == 0) {
        mu[i * prime[j]] = 0;
        break;
      } else {
        mu[i * prime[j]] = -mu[i];
      }
    }
  }
}
long long quickpowmod(long long x, long long y, long long mo) {
  long long ret = 1;
  while (y) {
    if (y & 1) {
      ret = ret * x % mo;
    }
    x = x * x % mo;
    y >>= 1;
  }
  return ret;
}
int a[100000 + 5];
int main() {
  Moblus();
  int n;
  scanf("%d", &n);
  memset(a, 0, sizeof(a));
  int x;
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    a[x]++;
  }
  long long ans = 0;
  ans = (ans + mod) % mod;
  for (int i = 1; i <= 100000; i++) {
    int cnt = 0;
    for (int j = i; j <= 100000; j += i) {
      cnt += a[j];
    }
    ans += mu[i] * (quickpowmod(2, cnt, mod) - 1);
    ans = (ans + mod) % mod;
  }
  printf("%lld\n", ans);
  return 0;
}
