#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const int MOD = 1e9 + 7;
const int N = 1e5 + 10;
int dp[N];
long long pow_mod(long long a, int n) {
  long long ret = 1;
  for (; n; n >>= 1) {
    if (n & 1) ret = ret * a % MOD;
    a = a * a % MOD;
  }
  return ret;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    for (int j = 1; j * j <= x; ++j) {
      if (x % j == 0) {
        dp[j]++;
        if (j * j != x) dp[x / j]++;
      }
    }
  }
  for (int i = 1; i < N; ++i) {
    dp[i] = (pow_mod(2, dp[i]) + MOD - 1) % MOD;
  }
  for (int i = N - 1; i >= 1; --i) {
    for (int j = i + i; j < N; j += i) {
      dp[i] = (dp[i] + MOD - dp[j]) % MOD;
    }
  }
  printf("%d\n", dp[1]);
  return 0;
}
