#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long a = 0, b = getchar(), c = 1;
  while (!isdigit(b)) c = b == '-' ? -1 : 1, b = getchar();
  while (isdigit(b)) a = a * 10 + b - '0', b = getchar();
  return a * c;
}
const int N = 1e5 + 5, mod = 1e9 + 7;
int n, dp[N], cnt[N], a[N] = {1};
int main() {
  for (int i = 1; i < N; i++) a[i] = a[i - 1] * 2 % mod;
  n = read();
  for (int i = 1; i <= n; i++) cnt[read()]++;
  for (int i = N - 1; i; i--) {
    int sum = 0, sub = 0;
    for (int j = i; j < N; j += i) sum += cnt[j], sub = (sub + dp[j]) % mod;
    dp[i] = (a[sum] - 1 - sub + mod) % mod;
  }
  printf("%d", dp[1]);
  return 0;
}
