#include <bits/stdc++.h>
using namespace std;
int n;
int a[100010], mob[100010], pr[100010], data[100010], cdata;
int cnt[100010];
int mobius() {
  int i, j;
  for (i = 1; i <= 100000; i++) mob[i] = 1;
  for (i = 2; i * i <= 100000; i++) {
    if (mob[i] == 1) {
      for (j = i; j <= 100000; j += i) {
        mob[j] *= -i;
      }
      for (j = i * i; j <= 100000; j += (i * i)) {
        mob[j] = 0;
      }
    }
  }
  for (i = 1; i <= 100000; i++) {
    if (mob[i] == i)
      mob[i] = 1;
    else if (mob[i] == -i)
      mob[i] = -1;
    else if (mob[i] > 0)
      mob[i] = -1;
    else if (mob[i] < 0)
      mob[i] = 1;
  }
  return 0;
}
long long int power(int x) {
  if (x == 0) return 0;
  long long int ans = 1;
  int i;
  for (i = 1; i <= x; i++) ans = (ans * 2) % 1000000007;
  ans = (ans + 1000000007 - 1) % 1000000007;
  return ans;
}
int prog() {
  int i, j;
  for (i = 0; i < n; i++) {
    for (j = 1; j * j <= a[i]; j++) {
      if ((a[i] % j) == 0) {
        cnt[j]++;
        if (j != (a[i] / j)) cnt[a[i] / j]++;
      }
    }
  }
  mobius();
  long long int ans = 0;
  for (i = 1; i <= 100000; i++)
    ans = (ans + 1000000007 + (mob[i] * power(cnt[i]))) % 1000000007;
  printf("%I64d", ans);
  return 0;
}
int main() {
  scanf("%d", &n);
  int i;
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  prog();
  return 0;
}
