#include <bits/stdc++.h>
using namespace std;
long long ans[100143], cnt[100143], pow2[100143];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n;
  cin >> n;
  vector<long long> vec(n);
  pow2[0] = 1;
  for (int i = 1; i < 100143 - 100; i++) {
    pow2[i] = (pow2[i - 1] * 2ll) % 1000000007;
  }
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
    cnt[vec[i]]++;
  }
  for (int i = 100143 - 100; i >= 1; i--) {
    long long sum = 0;
    for (int j = i; j < 100143; j += i) sum += cnt[j];
    long long curr = pow2[sum] - 1;
    for (int j = 2 * i; j < 100143; j += i) {
      curr = ((curr - ans[j]) % 1000000007 + 1000000007) % 1000000007;
    }
    ans[i] = curr;
  }
  cout << ans[1] << endl;
  return 0;
}
