#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void Cin(T &x) {
  register char c;
  for (c = getchar(); c < '0' || c > '9'; c = getchar())
    ;
  for (x = 0; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - '0';
}
const int Mod = 1e9 + 7, maxA = 1e5 + 1;
static int cnt[maxA], f[maxA], g[maxA], n, a;
inline int Pow(long long a, int b) {
  int res = 1;
  for (; b > 0; b >>= 1) {
    if (b & 1) res = res * a % Mod;
    a = a * a % Mod;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  while (--n >= 0) cin >> a, ++cnt[a];
  for (a = 1; a < maxA; ++a) {
    for (int b = a; b < maxA; b += a) f[a] += cnt[b];
    f[a] = Pow(2, f[a]) - 1;
  }
  for (a = maxA - 1; a > 0; --a) {
    g[a] = f[a];
    for (int b = a << 1; b < maxA; b += a)
      if ((g[a] -= g[b]) < 0) g[a] += Mod;
  }
  cout << g[1];
  return 0;
}
