#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
const long long MOD = 1e9 + 7;
long long n;
long long a[N], f[N], ans[N];
long long pow(long long a, long long b, long long m) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    f[a[i]]++;
  }
  for (long long i = 1e5; i >= 1; i--) {
    long long cur = f[i];
    for (long long j = 2 * i; j <= 1e5; j += i) cur += f[j];
    ans[i] = pow(2LL, cur, MOD) - 1;
    for (long long j = 2 * i; j <= 1e5; j += i)
      ans[i] = (ans[i] - ans[j] + MOD) % MOD;
  }
  cout << ans[1];
  return 0;
}
