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. 
/**
 * Created by Aminul on 10/17/2019.
 */

import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class CF585E {
    public static void main(String[] args) throws Exception {
        FastReader in = new FastReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        int n = in.nextInt();
        int mod = (int) 1e9 + 7;
        int maxn = (int) 1e7 + 1;

        byte m[] = enumMobiusByLPF(maxn);
        int f[] = new int[maxn];
        int twopow[] = new int[maxn];
        twopow[0] = 1;

        for (int i = 1; i <= n; i++) {
            int x = in.nextInt();
            f[x]++;
        }

        for (int i = 1; i < maxn; i++) {
            int sum = f[i];
            for (int j = i + i; j < maxn; j += i) {
               sum += f[j];
            }
            f[i] = sum;
            twopow[i] = (twopow[i - 1] * 2);
            if(twopow[i] >= mod) twopow[i] %= mod;
            twopow[i - 1] -= 1;
            if(twopow[i - 1] < 0) twopow[i - 1] += mod;
        }

        long ans = 0;
        int coprime[] = new int[maxn];
        for (int i = 1; i < maxn; i++) {
            long curr = 0;
            int cp = f[i] * m[i];
            for (int j = i, k = 1; j < maxn; j += i, k++) {
                curr += 1l * m[k] * twopow[f[j]];
                coprime[j] += cp;
            }
            if(i == 1 || curr == 0) continue;
            curr %= mod;
            ans += (coprime[i] * curr) % mod;
            if(ans >= mod) ans -= mod;
        }
        
        ans = ((ans % mod) + mod) % mod;

        pw.println(ans);

        pw.close();
    }


    static long bigMod(long a, long p, long m) { // returns (a^p) % m
        long res = 1 % m, x = a % m;
        while (p > 0) {
            if ((p & 1) > 0) res = (res * x) % m;
            x = (x * x) % m;
            p >>= 1;
        }
        return res;
    }

    public static byte[] enumMobiusByLPF(int n) { //UWI's implementation
        int lpf[] = enumLowestPrimeFactors(n);
        byte[] mob = new byte[n + 1];
        mob[1] = 1;
        for (int i = 2; i <= n; i++) {
            int j = i / lpf[i];
            if (lpf[j] != lpf[i]) {
                mob[i] = (byte) -mob[j];
            }
            /*else {
                mob[i] = 0;
            }*/
        }
        return mob;
    }

    public static int[] enumLowestPrimeFactors(int n) { //UWI's implementation
        int tot = 0;
        int[] lpf = new int[n + 1];
        int u = n + 32;
        double lu = log(u);
        int[] primes = new int[(int) (u / lu + u / lu / lu * 1.5)];
        for (int i = 2; i <= n; i++)
            lpf[i] = i;
        for (int p = 2; p <= n; p++) {
            if (lpf[p] == p)
                primes[tot++] = p;
            int tmp;
            for (int i = 0; i < tot && primes[i] <= lpf[p] && (tmp = primes[i] * p) <= n; i++) {
                lpf[tmp] = primes[i];
            }
        }
        return lpf;
    }


    static void debug(Object... obj) {
        System.err.println(Arrays.deepToString(obj));
    }

    static class FastReader {
        InputStream is;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0, ptrbuf = 0;

        public FastReader(InputStream is) {
            this.is = is;
        }

        public int readByte() {
            if (lenbuf == -1) throw new InputMismatchException();
            if (ptrbuf >= lenbuf) {
                ptrbuf = 0;
                try {
                    lenbuf = is.read(inbuf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (lenbuf <= 0) return -1;
            }
            return inbuf[ptrbuf++];
        }

        public boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public int skip() {
            int b;
            while ((b = readByte()) != -1 && isSpaceChar(b)) ;
            return b;
        }

        public String next() {
            int b = skip();
            StringBuilder sb = new StringBuilder();
            while (!(isSpaceChar(b))) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }


        public String nextLine() {
            int c = skip();
            StringBuilder sb = new StringBuilder();
            while (!isEndOfLine(c)) {
                sb.appendCodePoint(c);
                c = readByte();
            }
            return sb.toString();
        }

        public int nextInt() {
            int num = 0, b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            while (true) {
                if (b >= '0' && b <= '9') {
                    num = (num << 3) + (num << 1) + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public long nextLong() {
            long num = 0;
            int b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = (num << 3) + (num << 1) + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public char[] next(int n) {
            char[] buf = new char[n];
            int b = skip(), p = 0;
            while (p < n && !(isSpaceChar(b))) {
                buf[p++] = (char) b;
                b = readByte();
            }
            return n == p ? buf : Arrays.copyOf(buf, p);
        }

        public char readChar() {
            return (char) skip();
        }
    }
}
		 	  	 	 		  	  		  		 	 	  	