#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);
long long int power(long long int x, long long int y) {
  long long int ans = 1;
  x = x % MOD;
  while (y > 0) {
    if (y & 1) {
      ans *= x;
      ans %= MOD;
    }
    y = y >> 1;
    x = (x * x) % MOD;
  }
  return ans;
}
void solve() {
  long long int n, a;
  cin >> n;
  vector<long long int> cnt(1e5 + 2, 0);
  for (long long int i = 0; i < n; i++) {
    cin >> a;
    cnt[a]++;
  }
  vector<long long int> ans(1e5 + 2, 0);
  for (long long int gcd = 1e5; gcd >= 1; gcd--) {
    long long int no = 0, val = 0;
    for (long long int i = gcd; i <= 1e5; i += gcd) {
      no += cnt[i];
      val -= ans[i];
      val += MOD;
      val %= MOD;
    }
    val += power(2, no) - 1 + MOD;
    val %= MOD;
    ans[gcd] = val;
  }
  cout << ans[1] << endl;
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
