#include <bits/stdc++.h>
using namespace std;
const long long N = 2 * 1e5 + 1;
const long long inf = 1e9 + 7;
const long long MOD = 1e9 + 7;
long long a[N];
long long cnt[N];
long long poww(long long x, long long n) {
  if (n == 0) return 1;
  if (n % 2 == 0) return poww(x, n / 2) * poww(x, n / 2) % MOD;
  return poww(x, n - 1) * x % MOD;
}
long long f(long long x) {}
signed main() {
  long long n;
  cin >> n;
  long long ans = (poww(2, n) - 1 + MOD) % MOD;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 1) cnt[a[i]]++;
    long long x = a[i];
    for (long long i = 2; i * i <= x; i++) {
      if (x % i == 0) {
        cnt[i]++;
        if (i * i != x) cnt[x / i]++;
      }
    }
  }
  long long mx = 1e5 + 1;
  for (long long i = 2; i < mx; i++) {
    long long cc = 0;
    long long x = i;
    bool f = 0;
    for (long long j = 2; j * j <= x; j++) {
      if (x % j == 0) {
        long long cur = 0;
        while (x % j == 0) {
          x = x / j;
          cur++;
          cc++;
        }
        if (cur > 1) f = 1;
      }
    }
    if (x - 1) cc++;
    long long k = 0;
    if (!f && cc % 2 == 0)
      k = 1;
    else if (!f && cc % 2 == 1)
      k = -1;
    ans += k * (poww(2, cnt[i]) - 1 + MOD) % MOD;
    ans += MOD;
    ans %= MOD;
  }
  cout << ans << '\n';
  return 0;
}
