#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 1, mod = 1e9 + 7;
bitset<N> bs;
vector<long long> p;
long long n, a[N], mobius[N], cnt[N];
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1)
      (res *= a) %= mod, --b;
    else
      (a *= a) %= mod, b >>= 1;
  }
  return res;
}
void preset() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  bs.set();
  bs[1] = 0;
  for (long long i = 2; i < N; ++i) {
    if (bs[i]) {
      p.push_back(i);
      for (long long j = i * i; j < N; j += i) bs[j] = 0;
    }
  }
  for (long long i = 1; i < N; ++i) {
    if (i == 1) mobius[i] = 1;
    bool freed = true;
    long long tmp = i, num = 0;
    for (auto e : p) {
      if (e * e <= tmp) {
        long long cnt = 0;
        if (tmp % e == 0) ++num;
        while (tmp % e == 0) ++cnt, tmp /= e;
        freed &= (cnt < 2);
      } else {
        break;
      }
    }
    num += (tmp > 1);
    if (freed) mobius[i] = (num & 1 ? -1 : 1);
  }
}
signed main() {
  preset();
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> a[i];
  for (long long i = 1; i <= n; ++i) {
    for (long long j = 1; j * j <= a[i]; ++j) {
      if (a[i] % j == 0) {
        if (j != a[i] / j)
          ++cnt[j], ++cnt[a[i] / j];
        else
          ++cnt[j];
      }
    }
  }
  long long ans = 0;
  for (long long i = 1; i < N; ++i)
    (ans += mobius[i] * (binpow(2, cnt[i]) - 1) + mod) %= mod;
  cout << ans;
}
