#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  if (!b) return 1;
  long long res = power(a, b / 2);
  res = (res * res) % 1000000007;
  if (b & 1) res = ((res % 1000000007) * (a % 1000000007)) % 1000000007;
  return res;
}
void make_mobius(long long mobius[]) {
  long long fact[100001];
  for (long long i = 0; i < 100001; i++) fact[i] = 1;
  long long cnt[100001];
  memset(cnt, 0, sizeof(cnt));
  mobius[1] = 1;
  long long val;
  for (long long i = 2; i <= 100001 - 1; i++) {
    if (!cnt[i]) {
      fact[i] = i;
      cnt[i] = 1;
      for (long long j = 2; j <= (100001 - 1) / i; j++) {
        val = i * j;
        cnt[val]++;
        fact[val] *= i;
      }
    }
  }
  for (long long i = 2; i <= 100001 - 1; i++) {
    if (fact[i] == i) {
      if (cnt[i] & 1)
        mobius[i] = -1;
      else
        mobius[i] = 1;
    } else
      mobius[i] = 0;
  }
  return;
}
int main() {
  long long t;
  t = 1;
  long long mobius[100001];
  make_mobius(mobius);
  while (t--) {
    long long n;
    cin >> n;
    long long ar[n];
    for (long long i = 0; i < n; i++) cin >> ar[i];
    ;
    long long freq[100001];
    memset(freq, 0, sizeof(freq));
    for (long long i = 0; i < n; i++) freq[ar[i]]++;
    long long sum = 0;
    long long res = power(2ll, n) - 1;
    if (res < 0) res = (res + 1000000007) % 1000000007;
    res = (res + 1000000007) % 1000000007;
    for (long long i = 100001 - 1; i > 1; i--) {
      sum = freq[i];
      for (long long j = 2; j <= (100001 - 1) / i; j++) sum += freq[i * j];
      sum = power(2ll, sum) - 1;
      if (sum < 0) sum = (sum + 1000000007) % 1000000007;
      sum *= mobius[i];
      res += sum;
      if (res < 0) res += 1000000007;
      res %= 1000000007;
    }
    cout << res << "\n";
  }
  return 0;
}
