#include <bits/stdc++.h>
using namespace std;
long long n, pcnt, mcnt, ans, cnt[100001], pri[100001], mob[100001];
bool isnp[100001];
inline long long read() {
  long long q = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = 0;
    ch = getchar();
  }
  while (isdigit(ch)) q = (q << 3) + (q << 1) + (ch ^ 48), ch = getchar();
  return f ? q : -q;
}
inline void print(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + 48);
}
inline void prime() {
  isnp[0] = isnp[1] = 1;
  for (long long i = 2; i < 100001; ++i) {
    if (!isnp[i]) pri[++pcnt] = i;
    for (long long j = 1; j <= pcnt; ++j) {
      if (i * pri[j] > 100001) break;
      isnp[i * pri[j]] = 1;
      if (!(i % pri[j])) break;
    }
  }
}
inline void mobius() {
  mob[1] = 1;
  for (long long i = 2; i < 100001; ++i) {
    if (!isnp[i]) ++mcnt, mob[i] = -1;
    for (long long j = 1; j <= mcnt; ++j) {
      if (i * pri[j] > 100001) break;
      mob[i * pri[j]] = i % pri[j] ? -mob[i] : 0;
      if (!(i % pri[j])) break;
    }
  }
}
inline long long qpow(long long aa, long long bb) {
  long long anss = 1;
  while (bb) {
    if (bb & 1) anss = anss * aa % 1000000007;
    aa = aa * aa % 1000000007, bb >>= 1;
  }
  return anss;
}
signed main() {
  prime(), mobius(), n = read();
  while (n--) {
    long long x = read(), i = 1;
    for (; i < sqrt(x); ++i)
      if (!(x % i)) ++cnt[i], ++cnt[x / i];
    if (!((i * i) ^ x)) ++cnt[i];
  }
  for (long long i = 1; i < 100001; ++i)
    ans = (ans + ((qpow(2, cnt[i]) - 1 + 1000000007) % 1000000007) * mob[i] +
           1000000007) %
          1000000007;
  print(ans);
  return 0;
}
