#include <bits/stdc++.h>
using namespace std;
int long long freq[100005], a[100005], final[100005];
int long long pow1(int long long a, int long long b) {
  if (a == 0) return 0;
  int long long x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y);
      if (x > 1000000007) x %= 1000000007;
    }
    y = (y * y);
    if (y > 1000000007) y %= 1000000007;
    b /= 2;
  }
  return x % 1000000007;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int long long n;
  cin >> n;
  for (int long long i = 0; i < n; i++) {
    cin >> a[i];
    freq[a[i]]++;
  }
  for (int long long i = 100000; i >= 1; i--) {
    int long long c1 = 0;
    for (int long long j = i; j <= 100000; j = j + i) {
      c1 = (c1 + freq[j]) % 1000000007;
    }
    final[i] = (final[i] + pow1(2, c1) - 1) % 1000000007;
    for (int long long j = 2 * i; j <= 100000; j = j + i) {
      final[i] = (final[i] + 1000000007 - final[j]) % 1000000007;
    }
  }
  cout << final[1] << endl;
}
