#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
const long long mod = 1e9 + 7;
long long n, a[N], pw[N], dp[N], cnt[N];
void input() {
  scanf("%lld", &n);
  memset(cnt, 0, sizeof(cnt));
  pw[0] = 1;
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (long long i = 1; i <= n; i++) cnt[a[i]]++;
  for (long long i = 1; i < N; i++) pw[i] = (pw[i - 1] * 2) % mod;
}
void solve() {
  for (long long i = 1; i < N; i++) {
    for (long long j = i * 2; j < N; j = j + i) {
      cnt[i] += cnt[j];
    }
  }
  for (long long i = N - 1; i >= 1; i--) {
    dp[i] = pw[cnt[i]] - 1;
    for (long long j = i * 2; j < N; j = j + i) dp[i] = (dp[i] - dp[j]) % mod;
  }
  printf("%lld", (dp[1] % mod + mod) % mod);
}
signed main() {
  input();
  solve();
  return 0;
}
