#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long n, lo[1000006], f[1000005], bo[1000005];
int main() {
  lo[0] = 1;
  scanf("%lld", &n);
  for (int i = 1; i <= n; i++) {
    long long x;
    scanf("%lld", &x);
    ++bo[x];
    lo[i] = (lo[i - 1] * 2) % mod;
  }
  for (int i = 100005; i; i--) {
    long long t = 0;
    for (int j = i; j <= 100005; j += i) f[i] = (f[i] + f[j]) % mod, t += bo[j];
    f[i] = (mod - f[i] + lo[t] - 1 + mod) % mod;
  }
  printf("%lld", f[1]);
}
