#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
const long long mod = 1e9 + 7;
int freq[maxn];
long long dp[maxn];
long long pow2[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    freq[a]++;
  }
  pow2[0] = 1;
  for (int i = 1; i < maxn; i++) pow2[i] = (pow2[i - 1] * 2) % mod;
  for (int i = maxn - 1; i >= 1; i--) {
    int cntNum = 0;
    for (int j = i; j < maxn; j += i) cntNum += freq[j];
    dp[i] = (pow2[cntNum] - 1 + mod) % mod;
    for (int j = i + i; j < maxn; j += i) dp[i] = (dp[i] - dp[j] + mod) % mod;
  }
  cout << dp[1] << endl;
  return 0;
}
