#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const long long mod = 1e9 + 7;
vector<int> fac[N];
int valid[N], a[N], pr[N], cnt[N];
long long pow2[N];
int tot;
int main() {
  for (int i = 2; i <= 100000; i++) valid[i] = 1;
  for (int i = 2; i <= 100000; i++) {
    if (valid[i]) {
      fac[i].push_back(i);
      for (int j = i * 2; j <= 100000; j += i) {
        fac[j].push_back(i);
        valid[j] = 0;
      }
    }
  }
  tot = 0;
  for (int i = 2; i <= 100000; i++) {
    if (valid[i]) pr[++tot] = i;
  }
  pow2[0] = 1;
  for (int i = 1; i <= 100000; i++) pow2[i] = pow2[i - 1] * 2 % mod;
  int n, sz, prod;
  long long ans;
  scanf("%d", &n);
  memset(cnt, 0, sizeof(cnt));
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 1) continue;
    sz = fac[a[i]].size();
    for (int j = 1; j < (1 << sz); j++) {
      prod = 1;
      for (int k = 0; k < sz; k++) {
        if (j & (1 << k)) prod *= fac[a[i]][k];
      }
      cnt[prod]++;
    }
  }
  ans = (pow2[n] - 1 + mod) % mod;
  for (int i = 2; i <= 100000; i++) {
    if (cnt[i] == 0) continue;
    sz = fac[i].size();
    if (sz & 1)
      ans = (ans - pow2[cnt[i]] + 1 + mod) % mod;
    else
      ans = (ans + pow2[cnt[i]] - 1 + mod) % mod;
  }
  printf("%I64d\n", ans);
  return 0;
}
