#include <bits/stdc++.h>
int main(void) {
  long long mpow2[1 + (2 * 100 * 1000)];
  std::vector<std::pair<long long, long long>> pf[1 + (2 * 100 * 1000)];
  for (long long i = 2; i <= (2 * 100 * 1000); i++) {
    if (pf[i].empty()) {
      for (long long j = i; j <= (2 * 100 * 1000); j += i) {
        long long k, z;
        for (k = 0, z = j; z % i == 0; k++, z /= i)
          ;
        pf[j].push_back(std::make_pair(i, k));
      }
    }
  }
  mpow2[0] = 1;
  for (long long i = 1; i <= (2 * 100 * 1000); i++) {
    mpow2[i] = 2LL * mpow2[i - 1];
    mpow2[i] %= (1000LL * 1000LL * 1000LL + 7LL);
  }
  int n;
  scanf("%d", &n);
  long long count[1 + (2 * 100 * 1000)] = {};
  for (int i = 0; i < n; i++) {
    long long a;
    scanf("%lld", &a);
    if (a == 1) {
      count[1]++;
    } else {
      const auto& p = pf[a];
      for (long long b = 0;; b++) {
        long long k = 1;
        long long c = b;
        for (auto f : p) {
          long long x = c % (f.second + 1);
          c /= (f.second + 1);
          while (x--) {
            k *= f.first;
          }
        }
        if (c > 0) {
          break;
        }
        assert(k <= a);
        count[k]++;
      }
    }
  }
  long long grand_total = 0;
  for (int i = 1; i <= (2 * 100 * 1000); i++) {
    long long factor;
    if (i == 1) {
      factor = 1;
    } else {
      bool squarefree = true;
      long long prev = -1;
      for (auto f : pf[i]) {
        if (f.second > 1) {
          squarefree = false;
          break;
        }
      }
      if (squarefree) {
        factor = (pf[i].size() % 2 == 0) ? 1 : -1;
      } else {
        factor = 0;
      }
    }
    grand_total +=
        (((mpow2[count[i]] + ((1000LL * 1000LL * 1000LL + 7LL) - 1)) %
          (1000LL * 1000LL * 1000LL + 7LL)) *
         factor) %
        (1000LL * 1000LL * 1000LL + 7LL);
    grand_total += (1000LL * 1000LL * 1000LL + 7LL);
    grand_total %= (1000LL * 1000LL * 1000LL + 7LL);
  }
  printf("%lld\n", grand_total);
  return 0;
}
