#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAX{100010};
const ll MOD{1000000007};
set<ll> ps;
bitset<MAX> sieve;
void precomp() {
  ps.insert(2);
  ps.insert(3);
  sieve.set();
  for (ll i = 5, step = 2; i < MAX; i += step, step = 6 - step) {
    if (sieve[i]) {
      ps.insert(i);
      for (ll j = i * i; j < MAX; j += 2 * i) sieve[j] = false;
    }
  }
}
ll fast_exp(ll a, ll n) {
  ll res = 1, base = a;
  while (n) {
    if (n & 1) res = (res * base) % MOD;
    base = (base * base) % MOD;
    n >>= 1;
  }
  return res;
}
bitset<MAX> square_free;
int primes[MAX], hist[MAX], ns[MAX];
ll mod(ll n) { return ((n % MOD) + MOD) % MOD; }
ll solve(int N, const vector<int>& xs) {
  for (auto x : xs) ++hist[x];
  square_free.set();
  for (ll n = 2; n < MAX; ++n) {
    if (ps.count(n)) {
      auto p = n;
      for (ll i = p; i < MAX; i += p) {
        ++primes[i];
        ns[p] += hist[i];
      }
      for (ll i = p * p; i < MAX; i += p * p) square_free[i] = false;
    } else {
      for (ll i = n; i < MAX; i += n) ns[n] += hist[i];
    }
  }
  auto ans = mod(fast_exp(2, N) - 1);
  for (int i = 2; i < MAX; ++i) {
    if (not square_free[i] or ns[i] == 0) continue;
    ll term = (fast_exp(2, ns[i]) - 1) * (primes[i] % 2 ? -1 : 1);
    ans = mod(ans + term);
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  precomp();
  int N;
  cin >> N;
  vector<int> xs(N);
  for (int i = 0; i < N; ++i) cin >> xs[i];
  auto ans = solve(N, xs);
  cout << ans << '\n';
  return 0;
}
