#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7;
int freq[N];
long long dp[N];
long long fp(long long b, long long p) {
  if (p == 0) return 1;
  long long t = fp(b, p / 2);
  if (p % 2 == 0) return t * t % mod;
  return t * t % mod * b % mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    freq[x]++;
  }
  for (int i = N - 1; i > 0; i--) {
    int cnt = 0;
    for (int j = i; j < N; j += i) cnt += freq[j];
    dp[i] = fp(2, cnt) - 1;
    for (int j = i + i; j < N; j += i) dp[i] = (dp[i] - dp[j] + mod) % mod;
  }
  cout << dp[1] << endl;
  return 0;
}
