#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
const int MOD = 1e9 + 7;
int n, i, j, a[100005], nxt[100005], cnt[100005], pcnt[100005];
vector<int> pf[100005];
bool used[100005];
long long res[100005];
long long mypow(int lv) {
  if (lv == 0) return 1LL;
  long long tmp = mypow(lv / 2);
  tmp = (tmp * tmp) % MOD;
  if (lv & 1) tmp = (tmp * 2) % MOD;
  return tmp;
}
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  for (i = 2; i <= MAXN; i++) {
    if (!used[i]) {
      nxt[i] = i;
      long long p = (long long)i * i;
      while (p <= MAXN) {
        used[p] = 1;
        nxt[p] = i;
        p += i;
      }
    }
  }
  for (i = 2; i <= MAXN; i++) {
    int now = i;
    while (now > 1) {
      pf[i].push_back(nxt[now]);
      now /= nxt[now];
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 2; j <= sqrt(a[i]); j++) {
      if (a[i] % j == 0) {
        pcnt[j]++;
        if (a[i] / j != j) pcnt[a[i] / j]++;
      }
    }
    pcnt[1]++;
    pcnt[a[i]]++;
  }
  long long res = 0;
  for (i = 2; i <= MAXN; i++) {
    for (j = 0; j < pf[i].size(); j++) cnt[pf[i][j]]++;
    bool flag = 1;
    for (j = 0; j < pf[i].size(); j++) {
      flag &= (cnt[pf[i][j]] == 1);
      cnt[pf[i][j]] = 0;
    }
    if (!flag) continue;
    long long v = (mypow(pcnt[i]) - 1 + MOD) % MOD;
    if (pf[i].size() % 2 == 1)
      res = (res + v) % MOD;
    else
      res = (res - v + MOD) % MOD;
  }
  printf("%lld\n", ((mypow(n) - 1 + MOD) % MOD - res + MOD) % MOD);
}
