#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
inline long long power(long long a, long long b) {
  long long x = 1;
  a = a % 1000000007ULL;
  while (b) {
    if (b & 1) x = (x * a) % 1000000007ULL;
    a = (a * a) % 1000000007ULL;
    b >>= 1;
  }
  return x;
}
inline long long inv(long long a) { return power(a, 1000000007ULL - 2); }
long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; }
int n, a[N];
int no[N];
vector<int> prime[N];
int uwi[N];
bool vis[N];
void pre() {
  for (int i = 0; i <= 100000; i++) uwi[i] = -1;
  for (long long i = 2; i <= (long long)100000; i++) {
    if (!vis[i]) {
      for (long long j = i; j <= (long long)100000; j += i) {
        vis[j] = true;
        long long k = i * i;
        if (j % k == 0) uwi[j] = 0;
        prime[j].push_back(i);
      }
    }
  }
  for (int i = 0; i <= 100000; i++) {
    if (uwi[i] == -1) {
      if (prime[i].size() & 1)
        uwi[i] = -1;
      else
        uwi[i] = 1;
    }
  }
  for (int i = 0; i < n; i++) no[a[i]]++;
  for (int i = 2; i <= 100000; i++) {
    for (int j = 2 * i; j <= 100000; j += i) no[i] += no[j];
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  pre();
  long long ans = power(2, n) - 1;
  if (ans < 0) ans += 1000000007ULL;
  for (int i = 2; i <= 100000; i++) {
    long long tmp;
    if (no[i] == 0) continue;
    if (no[i] > 0) tmp = power(2, no[i]) - 1;
    if (tmp < 0) tmp += 1000000007ULL;
    ans += uwi[i] * tmp;
    if (ans < 0) ans += 1000000007ULL;
    if (ans >= 1000000007ULL) ans -= 1000000007ULL;
  }
  cout << ans << endl;
  return 0;
}
