#include <bits/stdc++.h>
using namespace std;
long long read() {
  char c = getchar();
  long long u = 0, f = 1;
  while (c != '-' && (c < '0' || '9' < c)) c = getchar();
  if (c == '-') {
    f = -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    u = u * 10 + c - '0';
    c = getchar();
  }
  return u * f;
}
char readc() {
  for (;;) {
    char c = getchar();
    if ('A' <= c && c <= 'Z' || 'a' <= c && c <= 'z') return c;
  }
}
int read_digit() {
  for (;;) {
    char c = getchar();
    if ('0' <= c && c <= '9') return c - '0';
  }
}
inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a < b ? a : b; }
template <typename T>
inline void updmax(T &a, T b) {
  if (b > a) a = b;
}
template <typename T>
inline void updmin(T &a, T b) {
  if (b < a) a = b;
}
inline void swap(int &a, int &b) {
  int t = a;
  a = b;
  b = t;
}
inline void fileio(string s) {
  if (s == "txt") {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  } else {
    freopen((s + ".in").c_str(), "r", stdin);
    freopen((s + ".out").c_str(), "w", stdout);
  }
}
int p2[100010], cnt[100010], f[100010];
int main() {
  p2[0] = 1;
  for (int i = 1; i <= 100000; i++) p2[i] = p2[i - 1] * 2 % 1000000007;
  int n = read(), m = 0;
  while (n--) {
    int u = read();
    cnt[u]++;
    updmax(m, u);
  }
  for (int i = 1; i <= m; i++) {
    for (int j = i; j <= m; j += i) f[i] += cnt[j];
    f[i] = p2[f[i]] - 1;
  }
  for (int i = m; i >= 1; i--) {
    for (int j = i + i; j <= m; j += i) f[i] = (f[i] - f[j]) % 1000000007;
  }
  cout << (f[1] + 1000000007) % 1000000007 << endl;
  return 0;
}
