#include <bits/stdc++.h>
using namespace std;
template <class T>
void splitstr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
static void redirect(int argc, const char **argv) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  if (argc > 1) {
    static filebuf f;
    f.open(argv[1], ios::in);
    cin.rdbuf(&f);
    if (!cin) {
      cerr << "Failed to open '" << argv[1] << "'" << endl;
      exit(1);
    }
  }
  if (argc > 2) {
    static filebuf f;
    f.open(argv[2], ios::out | ios::trunc);
    cout.rdbuf(&f);
    if (!cout) {
      cerr << "Failed to open '" << argv[2] << "'" << endl;
    }
  }
}
static constexpr long long MOD = 1000000007;
static long long pmod(long long a, long long b) {
  if (b == 0)
    return 1;
  else if (b & 1)
    return pmod(a, b - 1) * a % MOD;
  else {
    long long t = pmod(a, b / 2);
    return t * t % MOD;
  }
}
int main(int argc, const char **argv) {
  redirect(argc, argv);
  int N;
  cin >> N;
  int M = 100000;
  vector<long long> freq(M + 1);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    freq[a]++;
  }
  vector<long long> seqs(M + 1);
  for (int i = M; i >= 1; i--) {
    long long mult = 0;
    long long sub = 0;
    for (int j = i; j <= M; j += i) {
      mult += freq[j];
      sub = (sub + seqs[j]) % MOD;
    }
    seqs[i] = (pmod(2, mult) - 1 - sub) % MOD;
  }
  long long ans = seqs[1];
  if (ans < 0) ans += MOD;
  cout << ans << '\n';
  return 0;
}
