#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
const int mod = 1e9 + 7;
const int mex = 100005;
long long power(long long a, long long b) {
  long long ans = 1, f = a;
  while (b) {
    if (b & 1) ans = ans * f % mod;
    f = f * f % mod;
    b = b >> 1;
  }
  return ans;
}
signed main() {
  long long n;
  cin >> n;
  long long a[n];
  long long fr[mex] = {0};
  long long dp[mex + 1] = {0};
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    for (long long j = 1; j * j <= a[i]; j++) {
      if (a[i] % j == 0) {
        fr[j]++;
        if (j * j != a[i]) fr[a[i] / j]++;
      }
    }
  }
  for (long long i = mex - 1; i >= 1; i--) {
    dp[i] = (power(2, fr[i]) - 1 + mod) % mod;
    for (long long j = 2 * i; j < mex; j += i) {
      dp[i] = (dp[i] - dp[j] + mod) % mod;
    }
  }
  cout << dp[1] << endl;
}
