#include <bits/stdc++.h>
using namespace std;
bool isPrime[100010];
int mobius[100010], arr[100010], cnt[100010];
long long po[100010];
vector<int> divisors[100010];
void sieve() {
  for (int i = 1; i < 100010; i++) {
    mobius[i] = 1;
    isPrime[i] = 1;
  }
  isPrime[1] = 0;
  for (int i = 2; i < 100010; i++) {
    if (isPrime[i]) {
      mobius[i] = -mobius[i];
      for (int j = 2; i * j < 100010; j++) {
        isPrime[i * j] = 0;
        if (j % i == 0) {
          mobius[i * j] = 0;
        } else
          mobius[i * j] = -mobius[i * j];
      }
    }
  }
  for (int i = 1; i < 100010; i++) {
    for (int j = i; j < 100010; j += i) divisors[j].push_back(i);
  }
  po[0] = 1;
  for (int i = 1; i < 100010; i++) {
    po[i] = po[i - 1] * 2;
    if (po[i] < 0) po[i] += 1000000007;
    if (po[i] > 1000000007) po[i] %= 1000000007;
  }
}
int main() {
  sieve();
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    int len = divisors[arr[i]].size();
    for (int j = 0; j < len; j++) {
      cnt[divisors[arr[i]][j]]++;
    }
  }
  long long ans = 0;
  for (int i = 1; i <= 100000; i++) {
    ans = (ans + (mobius[i] * (po[cnt[i]] - 1))) % 1000000007;
  }
  printf("%I64d\n", (ans + 1000000007 + 1000000007) % 1000000007);
  return 0;
}
