#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, maxk = 10, mod = 1e9 + 7;
int prs[maxn][maxk], sz[maxn], cnt[maxn], pw[maxn];
bool pr[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int d;
    scanf("%d", &d);
    cnt[d]++;
  }
  pw[0] = 1;
  for (int i = 1; i < maxn; i++) pw[i] = (pw[i - 1] * 2) % mod;
  long long ans = pw[n] - 1;
  fill(pr, pr + maxn, true);
  for (int i = 2; i < maxn; i++) {
    int cur = 0;
    for (int j = i; j < maxn; j += i) {
      if (pr[i]) {
        pr[j] &= (i == j);
        prs[j][sz[j]++] = i;
      }
      cur += cnt[j];
    }
    int mul = 1;
    for (int j = 0; j < sz[i]; j++) mul *= prs[i][j];
    if (mul == i) {
      ans += (sz[i] & 1 ? -1 : 1) * (pw[cur] - 1);
      ans = (ans + mod) % mod;
    }
  }
  printf("%d\n", ans);
}
