#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 1;
const long long mod = 1e9 + 7;
vector<long long> d[N];
long long n, f[N];
void sieve() {
  for (long long i = 1; i < N; ++i) {
    f[i] = 1;
    for (long long j = i; j < N; j += i) d[j].push_back(i);
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  sieve();
  cin >> n;
  for (long long i = 1; i <= n; ++i) {
    long long x;
    cin >> x;
    for (long long y : d[x]) f[y] = f[y] * 2ll % mod;
  }
  for (long long i = 1; i < N; ++i) f[i]--;
  for (long long i = N - 1; i >= 1; --i)
    for (long long j = 2 * i; j < N; j += i) f[i] -= f[j];
  cout << (f[1] % mod + mod) % mod << endl;
}
