#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7;
const int N = (int)1e5;
typedef int arr[N + 10];
int n, m, k;
arr a, pw, mu, prm;
bool pri[N + 10];
void getprimes() {
  mu[1] = 1, pw[1] = 2, pw[0] = 1;
  for (int i = 2; i <= N; ++i) {
    pw[i] = (pw[i - 1] << 1) % mod;
    if (!pri[i]) prm[++m] = i, mu[i] = -1;
    for (int j = 1; j <= m; ++j) {
      if (i * prm[j] > N) break;
      pri[i * prm[j]] = 1;
      if (i % prm[j] == 0) {
        mu[i * prm[j]] = 0;
        break;
      } else
        mu[i * prm[j]] = -mu[i];
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &k), ++a[k];
  getprimes();
  int ans = pw[n] - 1;
  for (int i = 2; i <= N; ++i) {
    int cnt = 0;
    for (int j = i; j <= N; j += i) cnt += a[j];
    cnt = (long long)mu[i] * (long long)(pw[cnt] - 1) % mod;
    ans = (ans + cnt) % mod;
  }
  ans = (ans + mod) % mod;
  printf("%d\n", ans);
  return 0;
}
