Given are N positive integers A_1,...,A_N.

Consider positive integers B_1, ..., B_N that satisfy the following condition.

Condition: For any i, j such that 1 \leq i < j \leq N, A_i B_i = A_j B_j holds.

Find the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.

Since the answer can be enormous, print the sum modulo (10^9 +7).

Constraints

* 1 \leq N \leq 10^4
* 1 \leq A_i \leq 10^6
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N
A_1 ... A_N


Output

Print the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).

Examples

Input

3
2 3 4


Output

13


Input

5
12 12 12 12 12


Output

5


Input

3
1000000 999999 999998


Output

996989508
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jaynil
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        EFlatten solver = new EFlatten();
        solver.solve(1, in, out);
        out.close();
    }

    static class EFlatten {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int a[] = new int[n];
            for (int i = 0; i < n; i++) a[i] = in.nextInt();
            int pf[] = new int[1000001];
            long dp[] = new long[1000001];
            for (int i = 0; i < n; i++) {
                int count = 0;
                int temp = a[i];
                if (temp % 2 == 0) {
                    while (temp % 2 == 0) {
                        temp = temp / 2;
                        count++;
                    }
                }
                pf[2] = Math.max(pf[2], count);
                for (int j = 3; j * j <= temp; j++) {
                    count = 0;
                    if (temp % j == 0) {
                        while (temp % j == 0) {
                            temp = temp / j;
                            count++;
                        }
                    }
                    pf[j] = Math.max(pf[j], count);
                }
                if (temp >= 2) {
                    pf[temp] = Math.max(1, pf[temp]);
                }
            }
            long lcm = 1;
            int mod = 1000_000_007;

            for (int i = 2; i < 1000000; i++) {
                lcm *= Maths.power(i, pf[i], mod);
                lcm %= mod;
            }
            Maths.modInverseDP(1000000, mod, dp);
//        for(int i=0;i<5;i++)out.println(dp[i]);
            long ans = 0;
            for (int i = 0; i < n; i++) {
                ans += (lcm * dp[a[i]]) % mod;
                ans %= mod;
            }
            out.println(ans);
        }

    }

    static class Maths {
        static void modInverseDP(int n, int prime, long dp[]) {

            dp[0] = dp[1] = 1;
            for (int i = 2; i <= n; i++)
                dp[i] = dp[prime % i] *
                        (prime - prime / i) % prime;

        }

        static long power(long x, long y, long p) {
            long res = 1;
            x = x % p;
            while (y > 0) {
                if ((y & 1) == 1)
                    res = (res * x) % p;
                y = y >> 1;
                x = (x * x) % p;
            }
            return res;
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

