#include <bits/stdc++.h>
using namespace std;
int read() {
  int f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
inline int modadd(int x, int y) {
  return (x + y >= 1000000007 ? x + y - 1000000007 : x + y);
}
int poww(int a, int b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) res = 1ll * res * a % 1000000007;
    a = 1ll * a * a % 1000000007, b >>= 1;
  }
  return res;
}
int n, a[100005], cnt[100005] = {0};
int cntb[100005] = {0};
const int m = 100000;
int ans[100005];
void init() {
  n = read();
  for (int i = 1; i <= n; ++i) a[i] = read(), ++cnt[a[i]];
  for (int i = 1; i <= m; ++i)
    for (int j = i; j <= m; j += i) cntb[i] += cnt[j];
}
void solve() {
  for (int i = m; i >= 1; --i) {
    ans[i] = modadd(poww(2, cntb[i]), 1000000007 - 1);
    for (int j = i + i; j <= m; j += i)
      ans[i] = modadd(ans[i], 1000000007 - ans[j]);
  }
  printf("%d\n", ans[1]);
}
int main() {
  init();
  solve();
  return 0;
}
