#include <bits/stdc++.h>
using namespace std;
long long ans = 0;
long long mod = 1e9 + 7;
int cnt[100005], Tcnt[100005], arr[100005];
vector<int> pri;
void era() {
  pri.push_back(2);
  for (int i = 3; i <= 100000; i += 2) {
    if (!arr[i])
      for (long long j = (long long)i * i; j <= 100000; j += i) {
        arr[j] = 1;
      }
  }
  for (int i = 3; i <= 100000; i += 2) {
    if (arr[i] == 0) pri.push_back(i);
  }
}
int GGG(int p) {
  int ret = 0;
  for (int i = 0; i < pri.size(); i++) {
    if (pri[i] > p) break;
    int cnt = 0;
    while (p % pri[i] == 0) {
      p /= pri[i];
      ++cnt;
    }
    if (cnt >= 2) return -1;
    if (cnt != 0) ret++;
  }
  return ret;
}
long long po(int k) {
  if (k == 0) return 1;
  if (k == 1) return 2;
  long long ret = po(k / 2);
  ret = ret * ret % mod;
  if (k & 1) ret = ret * 2 % mod;
  return ret;
}
int main() {
  era();
  int n;
  scanf("%d", &n);
  for (int t, i = 1; i <= n; i++) {
    scanf("%d", &t);
    cnt[t]++;
  }
  for (int i = 2; i <= 100000; i++) {
    for (int j = i; j <= 100000; j += i) {
      Tcnt[i] += cnt[j];
    }
  }
  ans += po(n) - 1;
  for (int i = 2; i <= 100000; i++) {
    if (Tcnt[i] == 0) continue;
    int Gcnt = GGG(i);
    if (Gcnt == -1) continue;
    if (Gcnt % 2 == 0) {
      ans += po(Tcnt[i]) - 1;
      ans %= mod;
    } else {
      ans -= po(Tcnt[i]) - 1;
      while (ans < 0) ans += mod;
    }
  }
  printf("%I64d", ans);
}
