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.util.*;

class Main {
	static final int[] P;
	static {
		List<Integer> primes = new ArrayList<>();
		for (int i = 2; i <= 1000; i++) {
			int n = (int)Math.sqrt(i);
			int j = 2;
			for (; j <= n; j++) if (i%j == 0) break;
			if (j > n) primes.add(i);
		}
		P = new int[primes.size()];
		for (int i = 0; i < P.length; i++) P[i] = primes.get(i);
		
	}
	Scanner sc;
	int N;
	int[] A;
	int[][] F;
	static final int MOD = 1000_000_007;
	
	private void calc() {
		sc = new Scanner(System.in);
		N = sc.nextInt();
		A = new int[N];
		for (int i = 0; i < N; i++) A[i] = sc.nextInt();
		Map<Integer, Integer> lcmf = new HashMap<>();
		for (int i = 0; i < N; i++) {
			int a = A[i];
			for (int j = 0; j < P.length; j++) {
				int p = P[j];
				int c = 0;
				while (a%p == 0) {
					a /= p;
					c++;
				}
				if (c > 0) lcmf.put(p, Math.max(c, lcmf.getOrDefault(p, 0)));
				if (p*p > A[i]) break;
			}
			if (a > 1) lcmf.put(a, Math.max(1, lcmf.getOrDefault(a, 0)));
		}
		long lcm = 1;
		for (int p : lcmf.keySet()) {
			int c = lcmf.get(p);
			for (int i = 0; i < c; i++) lcm = (lcm * p)%MOD;
		}
		
		long ans = 0;
		for (int i = 0; i < N; i++) {
			long b = lcm * inv(A[i]) % MOD;
			ans = (ans + b) % MOD;
		}
		System.out.println(ans);
	}
	
	private static long inv(long a) {
		long b = MOD;
		long aa = a, bb = b;
		long x0 = 1, x1 = 0;
		long y0 = 0, y1 = 1;
	
		while (b != 0) {
			long q = a / b;
			long r = a % b;
			long x2 = x0 - q * x1;
			long y2 = y0 - q * y1;
	
			a = b; b = r;
			x0 = x1; x1 = x2;
			y0 = y1; y1 = y2;
		}
		if (bb > 0 && x0 < 0) {
			long n = -x0/bb;
			if (-x0%bb != 0) n++;
			x0 += n*bb; y0 -= n*aa;
		}
	    return x0;
	}
	
	public static void main(String[] args) {
		new Main().calc();
	}
}
