#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e5 + 10;
const long long mod = 1e9 + 7;
long long n, a[maxn], ok[maxn], f[maxn], g[maxn];
long long quick(long long x, long long n) {
  long long ans = 1;
  for (; n; n >>= 1, x = x * x % mod)
    if (n & 1) ans = ans * x % mod;
  return ans;
}
signed main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j * j <= a[i]; j++) {
      if (a[i] % j != 0) continue;
      ok[j]++;
      if (j != a[i] / j) ok[a[i] / j]++;
    }
  }
  for (long long i = 2; i <= 100000; i++) f[i] = quick(2, ok[i]) - 1;
  for (long long i = 100000; i >= 2; i--) {
    g[i] = f[i];
    for (long long j = i + i; j <= 100000; j += i) g[i] -= g[j];
  }
  long long ans = quick(2, n) - 1;
  for (long long i = 2; i <= 100000; i++) ans = (ans - g[i]) % mod;
  cout << (ans % mod + mod) % mod;
}
