#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x3f3f3f3f3f3f3f3f;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void zz() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }
const long long mx = 1e5 + 5;
vector<long long> mb(mx, 0);
vector<long long> a(mx, 1);
vector<long long> pr_cnt(mx, 0);
void mob() {
  for (long long i = 2; i < mx; i++) {
    if (pr_cnt[i]) continue;
    for (long long j = i; j < mx; j += i) {
      pr_cnt[j] += 1;
      a[j] *= i;
    }
  }
  for (long long i = 1; i < mx; i++) {
    if (a[i] == i) {
      if (pr_cnt[i] % 2)
        mb[i] = -1;
      else
        mb[i] = 1;
    } else {
      mb[i] = 0;
    }
  }
}
int32_t main() {
  zz();
  mob();
  long long n;
  cin >> n;
  vector<long long> v(n);
  vector<long long> freq(mx, 0);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    freq[v[i]] += 1;
  }
  vector<long long> po(mx, 0);
  po[0] = 1;
  for (long long i = 1; i < mx; i++) {
    po[i] = po[i - 1] * 2;
    po[i] %= 1000000007;
  }
  long long ans = 0;
  for (long long i = 1; i < mx; i++) {
    long long cnt = 0;
    for (long long j = i; j < mx; j += i) {
      cnt += freq[j];
    }
    long long tot = po[cnt] - 1;
    ans += tot * mb[i];
    ans = (ans + 1000000007) % 1000000007;
  }
  ans = (ans + 1000000007) % 1000000007;
  cout << ans << endl;
}
