#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  vector<long long> f(100001);
  for (int i = 0, x; i < n; ++i) {
    cin >> x;
    for (int i = 1; i * i <= x; ++i)
      if (x % i == 0) {
        ++f[i];
        if (i != x / i) ++f[x / i];
      }
  }
  vector<long long> p(100001);
  p[0] = 1;
  for (int i = 1; i < p.size(); ++i) p[i] = p[i - 1] * 2 % mod;
  for (auto &i : f) i = (p[i] + mod - 1) % mod;
  for (int i = 100000; i > 1; --i)
    for (int j = 1; j * j <= i; ++j)
      if (i % j == 0) {
        f[j] = (f[j] + mod - f[i]) % mod;
        if (j != 1 && j != i / j) f[i / j] = (f[i / j] + mod - f[i]) % mod;
      }
  cout << f[1] << "\n";
  return 0;
}
