#include <bits/stdc++.h>
using namespace std;
mt19937_64 rang(
    chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
  uniform_int_distribution<int> uid(0, lim - 1);
  return uid(rang);
}
long long mpow(long long base, long long exp);
long long power(long long a, long long b);
const long long mod = 1e9 + 7;
vector<int> g[1000001];
int cnt[1000001];
struct node {
  set<int> s;
};
struct segTree {
  long long arr[2001];
  long long res[8003];
  long long res1[8003];
  int NO_OPERATION = 0;
  void init(int x, int lo, int hi) {
    if (lo == hi) {
      res[x] = arr[lo];
      res1[x] = arr[lo];
      return;
    }
    int mid = (lo + hi) / 2;
    init(2 * x, lo, mid);
    init(2 * x + 1, mid + 1, hi);
    update_point1(x);
    update_point(x);
  }
  long long merge_results(long long a, long long b) { return a + b; }
  void point_change(int x, int lo, int hi, int l, int r) {
    if (lo > r || hi < l) return;
    if (res[x] < 3) return;
    if (lo == hi) {
      res[x] = cnt[res[x]];
      res1[x] = cnt[res1[x]];
      return;
    }
    int mid = (lo + hi) / 2;
    point_change(2 * x, lo, mid, l, r);
    point_change(2 * x + 1, mid + 1, hi, l, r);
    update_point1(x);
    update_point(x);
  }
  void point_modify(int x, int lo, int hi, int pos, long long val) {
    if (lo == hi) {
      res[x] = val;
      return;
    }
    int mid = (lo + hi) / 2;
    if (pos <= mid)
      point_modify(2 * x, lo, mid, pos, val);
    else
      point_modify(2 * x + 1, mid + 1, hi, pos, val);
    update_point(x);
  }
  long long get_val(int x, int lo, int hi, int pos) {
    if (lo == hi) return res[x];
    int mid = (lo + hi) / 2;
    if (pos <= mid)
      return get_val(2 * x, lo, mid, pos);
    else
      return get_val(2 * x + 1, mid + 1, hi, pos);
  }
  int max_query(int x, int lo, int hi) {
    if (lo == hi) return lo;
    int mid = (lo + hi) / 2;
    if (res[2 * x] >= res[2 * x + 1])
      return max_query(2 * x, lo, mid);
    else
      return max_query(2 * x + 1, mid + 1, hi);
  }
  void update_point(int x) { res[x] = max(res[2 * x], res[2 * x + 1]); }
  void update_point1(int x) { res1[x] = res1[2 * x] + res1[2 * x + 1]; }
  int query(int x, int lo, int hi, int l, int r) {
    if (lo >= l && hi <= r) return res[x];
    if (lo > r || hi < l) return INT_MAX;
    int mid = (lo + hi) / 2;
    return min(query(2 * x, lo, mid, l, r),
               query(2 * x + 1, mid + 1, hi, l, r));
  }
  long long sum_query(int x, int lo, int hi, int l, int r) {
    if (lo >= l && hi <= r) return res1[x];
    if (lo > r || hi < l) return 0;
    int mid = (lo + hi) / 2;
    return sum_query(2 * x, lo, mid, l, r) +
           sum_query(2 * x + 1, mid + 1, hi, l, r);
  }
  int kth_one(int x, int lo, int hi, int k) {
    if (lo == hi) return lo;
    int v1 = res[2 * x];
    int mid = (lo + hi) / 2;
    if (k <= v1)
      return kth_one(2 * x, lo, mid, k);
    else
      return kth_one(2 * x + 1, mid + 1, hi, k - v1);
  }
};
struct FenwickTree {
  int arr[100];
  int n;
  void update(int i, int delta) {
    while (i <= n) {
      arr[i] += delta;
      i = i + (i & (-i));
    }
  }
  int sum(int i) {
    if (i == 0) return 0;
    int res = 0;
    while (i > 0) {
      res = res + arr[i];
      i -= (i & (-i));
    }
    return res;
  }
};
struct dsu {
  int par[1001];
  int size_set[1001];
  int get_par(int u) {
    vector<int> temp;
    while (par[u] != u) {
      temp.push_back(u);
      u = par[u];
    }
    for (int i : temp) par[i] = u;
    return u;
  }
  void union_set(int a, int b) {
    a = get_par(a);
    b = get_par(b);
    if (a == b) return;
    if (size_set[a] < size_set[b]) {
      int temp = a;
      a = b;
      b = temp;
    }
    par[b] = a;
    size_set[a] += size_set[b];
  }
};
int check(string s1, string s2) {
  int n1 = s1.size();
  int n2 = s2.size();
  s1 = '$' + s1;
  s2 = '$' + s2;
  int dp[n1 + 1][n2 + 1];
  for (int j = 0; j <= n2; j++) dp[0][j] = 0;
  dp[0][0] = 1;
  for (int i = 1; i <= n1; i++) {
    dp[i][0] = 0;
  }
  int i1 = 1;
  while (i1 <= n1 && s1[i1] == '*') {
    dp[i1][0] = 1;
    i1++;
  }
  int sum[n2 + 1];
  int s = 0;
  for (int i = 0; i <= n2; i++) s = s + dp[0][i], sum[i] = s;
  for (int i = 1; i <= n1; i++) {
    for (int j = 1; j <= n2; j++) {
      char c1 = s1[i];
      char c2 = s2[j];
      if (c1 == '*') {
        if (sum[j] > 0)
          dp[i][j] = 1;
        else
          dp[i][j] = 0;
      } else if (c1 == '?') {
        dp[i][j] = dp[i - 1][j - 1];
      } else {
        if (c1 != c2)
          dp[i][j] = 0;
        else
          dp[i][j] = dp[i - 1][j - 1];
      }
    }
    s = 0;
    for (int j = 0; j <= n2; j++) {
      s += dp[i][j];
      sum[j] = s;
    }
  }
  return dp[n1][n2];
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int dist(pair<int, int> p1, pair<int, int> p2) {
  return abs(p1.first - p2.first) + abs(p2.second - p1.second);
}
int n;
int find_bfs_steps(int u) {
  queue<int> q;
  q.push(u);
  int vis[101];
  for (int i = 1; i <= 100; i++) vis[i] = 0;
  int step = 0;
  q.push(-1);
  vis[u] = 1;
  while (q.size() > 1) {
    while (q.front() != -1) {
      int k = q.front();
      q.pop();
      vis[k] = 1;
      for (int i : g[k]) {
        if (vis[i] == 0) q.push(i), vis[i] = 1;
      }
    }
    step++;
    q.pop();
    q.push(-1);
  }
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 0) return INT_MAX;
  }
  return step;
}
string a[301];
int cnt_nh(int i, int j) {
  vector<int> del_i = {1, 0, -1, 0};
  vector<int> del_j = {0, 1, 0, -1};
  int res = 0;
  for (int t = 0; t < 4; t++) {
    int i1 = i + del_i[t];
    int j1 = j + del_j[t];
    if (i1 >= 0 && i1 < n && j1 >= 0 && j1 < n) {
      if (a[i1][j1] == 'X') res++;
    }
  }
  return res;
}
void solve() {
  int cnt[100001];
  int f[100001];
  int g[100001];
  memset(cnt, 0, sizeof(cnt));
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int u;
    cin >> u;
    cnt[u]++;
  }
  for (int i = 1; i <= 100000; i++) {
    int c = 0;
    for (int j = i; j <= 100000; j += i) c = (c + cnt[j]) % mod;
    g[i] = c;
  }
  for (int i = 1; i <= 100000; i++) g[i] = (mpow(2, g[i]) - 1 + mod) % mod;
  memset(f, 0, sizeof(f));
  for (int i = 100000; i >= 1; i--) {
    f[i] = g[i];
    for (int j = 2 * i; j <= 100000; j += i) f[i] = (f[i] - f[j] + mod) % mod;
  }
  cout << f[1] << "\n";
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
long long mpow(long long base, long long exp) {
  base %= mod;
  long long result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((long long)result * base) % mod;
    base = ((long long)base * base) % mod;
    exp >>= 1;
  }
  return result;
}
long long power(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 0) {
      b /= 2;
      a = a * a;
    } else {
      res = res * a;
      b--;
    }
  }
  return res;
}
