#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const long long MOD = 1e9 + 7;
int f[MAXN];
long long mob[MAXN];
long long raise(long long a, long long p) {
  if (p == 0) return 1;
  long long cur = raise(a, p / 2) % MOD;
  cur = (cur * cur) % MOD;
  if (p % 2)
    return (cur * a) % MOD;
  else
    return cur;
}
void gen() {
  mob[1] = 1;
  for (int i = 2; i < MAXN; ++i) {
    mob[i] = -1;
    for (int j = 2; j * j <= i; ++j) {
      if (i % j == 0) {
        if ((i / j) % j == 0)
          mob[i] = 0;
        else
          mob[i] = mob[i / j] * (-1);
        break;
      }
    }
  }
}
int main() {
  gen();
  int N;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    int x;
    cin >> x;
    ++f[x];
  }
  long long res = 0;
  for (int i = 1; i <= MAXN; ++i) {
    long long cnt = 0;
    for (int j = i; j <= MAXN; j += i) cnt += f[j];
    res += (raise(2, cnt) - 1) * mob[i];
    res %= MOD;
  }
  cout << (res + MOD) % MOD;
}
