#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 100010;
const int mod = 1e9 + 7;
long long a[N];
long long dp[N];
int n;
long long p[N];
int main() {
  scanf("%d", &n);
  p[0] = 1;
  for (int i = 1; i <= n; i++) {
    p[i] = (p[i - 1] * 2ll) % mod;
    int x;
    scanf("%d", &x);
    a[x]++;
  }
  for (int i = N - 1; i; i--) {
    long long sum = 0;
    for (int j = i; j < N; j += i) sum = sum + a[j];
    dp[i] = p[sum] - 1;
    for (int j = 2 * i; j < N; j += i) dp[i] = (dp[i] - dp[j] + mod) % mod;
  }
  printf("%lld\n", dp[1]);
  return 0;
}
