#include <bits/stdc++.h>
using namespace std;
const long long int N = 100005;
long long int a[N], prime_count[N] = {0}, mobius[N];
long long int freq[N], p2[N];
void cal_mobius() {
  for (long long int i = 0; i < N; i++) {
    a[i] = 1;
  }
  for (long long int i = 2; i < N; i++) {
    if (prime_count[i]) continue;
    for (long long int j = i; j < N; j += i) {
      prime_count[j]++;
      a[j] = a[j] * i;
    }
  }
  mobius[1] = 1;
  for (long long int i = 2; i < N; i++) {
    if (a[i] == i) {
      if (prime_count[i] % 2 == 0) {
        mobius[i] = 1;
      } else
        mobius[i] = -1;
    } else
      mobius[i] = 0;
  }
}
int main() {
  long long int n;
  cin >> n;
  cal_mobius();
  long long int b[n];
  for (long long int i = 0; i < n; i++) {
    cin >> b[i];
    freq[b[i]]++;
  }
  p2[0] = 1;
  for (long long int i = 1; i < N; i++) {
    p2[i] = p2[i - 1] * 2;
    p2[i] = p2[i] % 1000000007;
  }
  long long int count = 0, ans = 0;
  for (long long int i = 1; i < N; i++) {
    count = 0;
    for (long long int j = i; j < N; j += i) {
      count = count + freq[j];
    }
    long long int tot_subsequences = p2[count] - 1;
    ans = ans + (mobius[i] * tot_subsequences);
    ans = ans % 1000000007;
  }
  ans = ans + 1000000007;
  cout << ans % 1000000007 << endl;
  return 0;
}
