Vitalik the philatelist has a birthday today!

As he is a regular customer in a stamp store called 'Robin Bobin', the store management decided to make him a gift.

Vitalik wants to buy one stamp and the store will give him a non-empty set of the remaining stamps, such that the greatest common divisor (GCD) of the price of the stamps they give to him is more than one. If the GCD of prices of the purchased stamp and prices of present stamps set will be equal to 1, then Vitalik will leave the store completely happy.

The store management asks you to count the number of different situations in which Vitalik will leave the store completely happy. Since the required number of situations can be very large, you need to find the remainder of this number modulo 109 + 7. The situations are different if the stamps purchased by Vitalik are different, or if one of the present sets contains a stamp that the other present does not contain.

Input

The first line of the input contains integer n (2 ≤ n ≤ 5·105) — the number of distinct stamps, available for sale in the 'Robin Bobin' store. 

The second line contains a sequence of integers a1, a2, ..., an (2 ≤ ai ≤ 107), where ai is the price of the i-th stamp.

Output

Print a single integer — the remainder of the sought number of situations modulo 109 + 7.

Examples

Input

3
2 3 2


Output

5


Input

2
9 6


Output

0

Note

In the first sample the following situations are possible: 

  * Vitalik buys the 1-st stamp, the store gives him the 2-nd stamp as a present; 
  * Vitalik buys the 3-rd stamp, the store gives him the 2-nd stamp as a present; 
  * Vitalik buys the 2-nd stamp, the store gives him the 1-st stamp as a present; 
  * Vitalik buys the 2-nd stamp, the store gives him the 3-rd stamp as a present; 
  * Vitalik buys the 2-nd stamp, the store gives him the 1-st and 3-rd stamps as a present. 
#include <bits/stdc++.h>
using namespace std;
const int N = 500100, mod = 1e9 + 7, M = 10000001;
int f[N], p[M], tot, c[M], mu[M], a[N], b[N][20], bn[N];
bool is[M];
int cal(int x) { return f[x] - 1; }
void add(int &x, int y) {
  if (y < 0) y += mod;
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  f[0] = 1;
  for (int i = 1; i < N; i++) f[i] = f[i - 1] * 2 % mod;
  mu[1] = 1;
  for (int i = 2; i < M; i++) {
    if (!is[i]) {
      p[tot++] = i;
      mu[i] = -1;
    }
    for (int j = 0; j < tot && i * p[j] < M; j++) {
      is[i * p[j]] = 1;
      if (i % p[j] == 0) {
        mu[i * p[j]] = 0;
        break;
      }
      mu[i * p[j]] = -mu[i];
    }
  }
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    int tmp = a[i];
    bn[i] = 0;
    for (int j = 0; p[j] * p[j] <= tmp; j++)
      if (tmp % p[j] == 0) {
        while (tmp % p[j] == 0) tmp /= p[j];
        b[i][bn[i]++] = p[j];
      }
    if (tmp != 1) b[i][bn[i]++] = tmp;
    for (int j = 1; j < (1 << bn[i]); j++) {
      int tmp = 1;
      for (int k = 0; k < bn[i]; k++)
        if (j & (1 << k)) {
          tmp *= b[i][k];
        }
      c[tmp]++;
    }
  }
  int res = 0;
  for (int i = 1; i <= n; i++) {
    add(res, cal(n - 1));
    for (int j = 1; j < (1 << bn[i]); j++) {
      int tmp = 1;
      for (int k = 0; k < bn[i]; k++)
        if (j & (1 << k)) {
          tmp *= b[i][k];
        }
      add(res, mu[tmp] * cal(c[tmp] - 1));
    }
  }
  add(res, -1LL * n * cal(n - 1) % mod);
  for (int i = 2; i < M; i++)
    if (c[i]) {
      add(res, -mu[i] *
                   (1LL * c[i] * cal(c[i] - 1) + 1LL * (n - c[i]) * cal(c[i])) %
                   mod);
    }
  cout << res << endl;
}
