#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
const int N = 1e5 + 5;
const int M = 22;
int freq[N], p2[N];
int a[N], prime_ct[N], mobius[N];
void cal_mobius() {
  int i, j;
  for (int i = 1; i <= N - 1; i++) {
    a[i] = 1;
  }
  for (int i = 2; i <= N - 1; i++) {
    if (prime_ct[i]) continue;
    for (int j = i; j < N; j += i) {
      prime_ct[j]++;
      a[j] *= i;
    }
  }
  for (int i = 1; i <= N - 1; i++) {
    if (a[i] == i) {
      if (prime_ct[i] & 1)
        mobius[i] = -1;
      else
        mobius[i] = 1;
    } else
      mobius[i] = 0;
  }
}
void solve() {
  int i, j, k, m, ans = 0, cnt = 0;
  cal_mobius();
  int n;
  cin >> n;
  int arr[n];
  memset(arr, 0, sizeof(arr));
  for (int i = 0; i <= n - 1; i++) {
    cin >> arr[i];
    freq[arr[i]]++;
  }
  p2[0] = 1;
  for (int i = 1; i <= N - 1; i++) {
    p2[i] = p2[i - 1] * 2;
    p2[i] %= MOD;
  }
  for (int i = 1; i <= N - 1; i++) {
    cnt = 0;
    for (int j = i; j < N; j += i) {
      cnt += freq[j];
    }
    int tot_sbsq = p2[cnt] - 1;
    ans += mobius[i] * tot_sbsq;
    ans %= MOD;
  }
  ans += MOD;
  cout << ans % MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
