#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long N = 1e5 + 5;
vector<long long> dvs[N + 2];
long long f[N + 2], cnt[N + 2], pw[N + 2], a;
signed main() {
  pw[0] = 1;
  for (long long i = 1; i <= N; ++i) {
    for (long long j = i << 1; j <= N; j += i) {
      dvs[j].push_back(i);
    }
  }
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; ++i) {
    cin >> a;
    ++cnt[a];
    for (long long j = 0; j < dvs[a].size(); ++j) {
      cnt[dvs[a][j]]++;
    }
    pw[i] = (pw[i - 1] << 1) % mod;
  }
  for (long long i = N; i >= 1; --i) {
    f[i] = pw[cnt[i]] - 1;
    for (long long j = i << 1; j <= N; j += i) {
      f[i] = (f[i] - f[j] + mod) % mod;
    }
  }
  cout << f[1];
}
