#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const long long mod = 1e9 + 7;
int c[N], cnt[N];
vector<int> p[N], d[N];
long long Pow(long long a, long long b) {
  if (b == 0) return 1;
  long long res = Pow(a, b / 2);
  res = res * res % mod;
  if (b & 1) res = res * a % mod;
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 2; i < N; i++)
    if (p[i].empty())
      for (int j = i; j < N; j += i) p[j].push_back(i);
  for (int i = 1; i < N; i++)
    for (int j = i; j < N; j += i) d[j].push_back(i);
  for (int i = 1; i < N; i++) {
    int x = i, t = 0;
    for (int j : p[i])
      while (x % j == 0) x /= j, t++;
    if (t == p[i].size()) c[i] = (p[i].size() & 1 ? -1 : 1);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    for (int j : d[x]) cnt[j]++;
  }
  long long ans = 0;
  for (int i = 1; i < N; i++)
    ans = (ans + c[i] * (Pow(2, cnt[i]) - 1) % mod) % mod;
  ans = (ans + mod) % mod;
  cout << ans;
  return 0;
}
