#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int mod = 1000000007;
const double PI = acos(-1.0);
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
int h[100007];
long long f[100007];
const int o = 100000;
long long quickpow(long long m, long long n, long long k) {
  long long b = 1;
  m = m % k;
  while (n > 0) {
    if (n & 1) b = (b * m) % k;
    n = n >> 1;
    m = (m * m) % k;
  }
  return b;
}
int main() {
  int n, m;
  scanf("%d", &n);
  while (n--) {
    scanf("%d", &m);
    for (int i = 1; i * i <= m; i++) {
      if (m % i == 0) {
        h[i]++;
        if (i * i != m) h[m / i]++;
      }
    }
  }
  for (int i = 1; i <= o; i++) f[i] = quickpow(2, h[i], mod) - 1;
  for (int i = o; i; i--) {
    for (int j = i + i; j <= o; j += i) {
      f[i] = (f[i] - f[j] + mod) % mod;
    }
  }
  cout << f[1] << endl;
  return 0;
}
