#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << H;
  debug_out(T...);
}
const int INF = 0x3f3f3f3f, m197 = (int)1e9 + 7;
const int N = 1e5 + 10;
void s_solve() {
  vector<bool> st(N);
  vector<int> cnt(N);
  for (int i = 2; i < N; ++i) {
    if (st[i]) continue;
    cnt[i] = 1;
    for (int j = 2 * i; j < N; j += i) {
      st[j] = true;
      if (cnt[j] == -1) continue;
      if ((j / i) % i == 0)
        cnt[j] = -1;
      else
        ++cnt[j];
    }
  }
  int n;
  cin >> n;
  vector<int> p2(n + 1);
  p2[0] = 1;
  for (int i = 1; i <= n; ++i) {
    p2[i] = p2[i - 1] * 2 % m197;
  }
  vector<int> a(N);
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x;
    for (int j = 1; j * j <= x; ++j) {
      if (x % j) continue;
      ++a[j];
      if (x / j != j) ++a[x / j];
    }
  }
  int res = p2[n] - 1;
  for (int i = 2; i < N; ++i) {
    if (cnt[i] == -1) continue;
    if (cnt[i] & 1)
      res = (res - p2[a[i]] + 1) % m197;
    else
      res = (res + p2[a[i]] - 1) % m197;
  }
  res = (res + m197) % m197;
  cout << res << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(10);
  int _T = 1, _C = 1;
  while (_C++ <= _T) {
    s_solve();
  }
  return 0;
}
