#include <bits/stdc++.h>
using namespace std;
const int mx = 1e5 + 10;
const long long md = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> cnt(mx);
  for (int i = 0; i < (n); ++i) {
    int a;
    cin >> a;
    ++cnt[a];
  }
  vector<int> tva(mx, 1);
  for (int i = 1; i < (mx); ++i) tva[i] = tva[i - 1] * 2 % md;
  vector<long long> ans(mx);
  for (int d = mx; d-- > (1);) {
    int c = 0;
    for (int i = d; i < mx; i += d) {
      ans[d] -= ans[i];
      c += cnt[i];
    }
    ans[d] += tva[c] - 1;
    ans[d] %= md;
  }
  if (ans[1] < 0) ans[1] += md;
  cout << ans[1] << endl;
}
