#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int _inf = 0xc0c0c0c0;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long _INF = 0xc0c0c0c0c0c0c0c0;
const long long mod = (int)1e9 + 7;
const int N = 1e5 + 100;
int cnt[N];
long long ans[N];
long long Qpow[N];
int main() {
  Qpow[0] = 1;
  int n, v;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &v);
    cnt[v]++;
  }
  int maxv = 1e5;
  for (int i = 1; i <= maxv; ++i) {
    Qpow[i] = Qpow[i - 1] * 2;
    if (Qpow[i] >= mod) Qpow[i] -= mod;
  }
  for (int i = 0; i <= maxv; ++i) {
    Qpow[i] -= 1;
    if (Qpow[i] == -1) Qpow[i] += mod;
  }
  long long tot = 0;
  for (int i = maxv; i >= 2; --i) {
    int now = 0;
    for (int j = i; j <= maxv; j += i) {
      now += cnt[j];
      ans[i] -= ans[j];
    }
    ans[i] += Qpow[now];
    ans[i] = (ans[i] % mod + mod) % mod;
    tot = ((tot + ans[i]) % mod + mod) % mod;
  }
  tot = Qpow[n] - tot;
  tot = (tot % mod + mod) % mod;
  cout << tot << endl;
  return 0;
}
