#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long read() {
  long long s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * f;
}
inline void print(long long *f, long long len) {
  for (long long i = 0; i < len; i++) printf("%lld ", f[i]);
  puts("");
}
long long a[101010];
long long pw[101010];
long long cnt[101010];
long long dp[101010];
const long long mod = 1e9 + 7;
signed main() {
  n = read();
  pw[0] = 1;
  for (long long i = 1, iend = n; i <= iend; ++i)
    a[i] = read(), pw[i] = (pw[i - 1] * 2) % mod, cnt[a[i]]++;
  for (long long i = 100000, iend = 1; i >= iend; --i) {
    long long sum = 0;
    for (long long j = i; j <= 100000; j += i) sum += cnt[j];
    dp[i] = pw[sum] - 1;
    for (long long j = i * 2; j <= 100000; j += i)
      dp[i] += mod, dp[i] -= dp[j], dp[i] %= mod;
  }
  cout << dp[1];
}
