#include <bits/stdc++.h>
using namespace std;
long long int expo(long long int a, long long int b) {
  long long int r = 1;
  a = a % 1000000007;
  while (b) {
    if (b % 2) r = (r * a) % 1000000007;
    a = (a * a) % 1000000007;
    b = b / 2;
  }
  return r;
}
long long int ans[100001];
long long int f[100001];
long long int cnt[100001] = {};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  long long int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    f[a[i]]++;
  }
  for (int i = 1; i <= 100000; i++) {
    for (int j = i; j <= 100000; j += i) {
      cnt[i] = (cnt[i] + f[j]) % 1000000007;
    }
    ans[i] = (expo(2, cnt[i]) - 1ll + 1000000007) % 1000000007;
  }
  for (int i = 100000; i >= 1; i--) {
    for (int j = 2 * i; j <= 100000; j += i) {
      ans[i] = (ans[i] - ans[j] + 1000000007) % 1000000007;
    }
  }
  cout << ans[1] << endl;
  return 0;
}
