#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long fact[100001];
long long inv[100001];
long long power(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b % 2) {
      ans = (ans * a) % MOD;
    }
    a = (a * a) % MOD;
    b /= 2;
  }
  return ans;
}
void init_code() {}
void init_fact() {
  fact[0] = 1;
  for (long long i = 1; i <= 100000; i++) {
    fact[i] = (i * fact[i - 1]) % MOD;
  }
}
void init_inv() {
  for (long long i = 1; i <= 100000; i++) {
    inv[i] = power(fact[i], MOD - 2);
  }
}
long long C(long long n, long long r) {
  return ((fact[n] *
           ((power(fact[n - r], MOD - 2) * (power(fact[r], MOD - 2))) % MOD)) %
          MOD);
}
long long a[1000001], f[100001], cnt[100001], freq[100001];
long long n;
void solve() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    freq[a[i]]++;
  }
  for (long long i = 1; i <= 100000; i++) {
    for (long long j = i; j <= 100000; j += i) {
      cnt[i] += freq[j];
    }
  }
  for (long long g = 100000; g >= 1; g--) {
    long long total = (power(2, cnt[g]) - 1 + MOD) % MOD;
    f[g] = total;
    for (long long j = 2 * g; j <= 100000; j += g) {
      f[g] = (f[g] - f[j] + MOD) % MOD;
    }
  }
  cout << f[1] << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
  return 0;
}
