#include <bits/stdc++.h>
using namespace std;
long long int expo(long long int base, long long int exponent,
                   long long int modulo) {
  long long int ans = 1;
  while (exponent != 0) {
    if (exponent & 1) ans = (ans * base) % modulo;
    base = (base * base) % modulo;
    exponent >>= 1;
  }
  return ans % modulo;
}
int main() {
  long long int n, arr[100005], freq[100005], cnt[100005], f[100005];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    freq[arr[i]]++;
  }
  for (int i = 1; i <= 100000; i++) {
    for (int j = i; j <= 100000; j += i) {
      cnt[i] += freq[j];
    }
  }
  for (int g = 100000; g >= 1; g--) {
    int total = (expo(2, cnt[g], 1000000007) - 1 + 1000000007) % 1000000007;
    f[g] = total;
    for (int j = 2 * g; j <= 100000; j += g) {
      f[g] = (f[g] - f[j] + 1000000007) % 1000000007;
    }
  }
  cout << f[1] << endl;
  return 0;
}
