#include <bits/stdc++.h>
using namespace std;
int n, x, cnt[100001], pr[100001];
vector<int> divs[100001];
void MOBIUS_T(int *a, int n, bool forth) {
  if (forth)
    for (int i = 1; i <= n; i++)
      for (auto k : divs[i]) a[k] = (0LL + a[k] + a[i]) % 1000000007;
  else
    for (int i = n; i >= 1; i--)
      for (auto k : divs[i])
        a[k] = (0LL + a[k] - a[i] + 1000000007) % 1000000007;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  memset(cnt, 0, 100001 * sizeof(int));
  cin >> n;
  for (int i = 1; i < 100001; i++) {
    for (int j = i * 2; j < 100001; j += i) divs[j].push_back(i);
  }
  pr[0] = 1;
  for (int i = 1; i <= n; i++) pr[i] = (pr[i - 1] << 1LL) % 1000000007;
  for (int i = 0; i < n; i++) cin >> x, cnt[x]++;
  MOBIUS_T(cnt, 100001 - 1, true);
  for (int i = 1; i < 100001; i++)
    cnt[i] = ((pr[cnt[i]] - 1LL) % 1000000007 + 1000000007) % 1000000007;
  MOBIUS_T(cnt, 100001 - 1, false);
  cout << cnt[1] << endl;
  return 0;
}
