#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const int MOD = 1e9 + 7;
const int N = 1e5 + 5;
vector<long long> dp(N);
vector<long long> cnt(N);
vector<int> v;
int n;
long long power(long long x, long long y) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (ans * x) % MOD;
    x = (x * x) % MOD;
    y >>= 1;
  }
  return ans;
}
void solve() {
  for (int &i : v) cnt[i]++;
  for (int i = 1; i < N; i++)
    for (int j = i + i; j < N; j += i) cnt[i] += cnt[j];
  for (int i = N - 1; i > 0; i--) {
    dp[i] = (power(2, cnt[i]) - 1LL + MOD) % MOD;
    for (int j = i + i; j < N; j += i) dp[i] = (dp[i] - dp[j] + MOD) % MOD;
  }
  cout << dp[1] << "\n";
}
int main() {
  fast();
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  solve();
}
