#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
void init_ios() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}
const long long N = (long long)1e5 + 3;
const long long MOD = (long long)1e9 + 7;
long long n, a[N], cnt[N], f[N], dp[N];
long long fpow(long long x, long long y) {
  if (y == 0) return 1;
  if (y & 1) return (x * fpow(x, y - 1)) % MOD;
  long long res = fpow(x, y / 2);
  return (res * res) % MOD;
}
signed main() {
  init_ios();
  cin >> n;
  for (long long i = 1; i <= n; ++i) {
    cin >> a[i];
    for (long long j = 1; j * j <= a[i]; ++j) {
      if (a[i] % j == 0) {
        cnt[j]++;
        if (j * j < a[i]) cnt[a[i] / j]++;
      }
    }
  }
  for (long long i = 1; i < N; ++i) f[i] = fpow(2, cnt[i]) - 1;
  for (long long i = N - 1; i > 0; --i) {
    dp[i] = f[i];
    for (long long j = 2 * i; j < N; j += i) {
      dp[i] -= dp[j];
      if (dp[i] < 0) dp[i] += MOD;
    }
  }
  cout << dp[1] << "\n";
}
