function Main(input) {
	input = input.trim().split("\n").map(function(x) { return x.split(" ")});
	let C = 1e9 + 7;
	let C2 = 1e5;
	let N = parseInt(input[0][0], 10);
	let v_A = input[1].map(e => parseInt(e, 10));

	let v_TF = Array.from({length: 1e6}, () => true);
	for (let i = 2;  i <= 1e6 / 2; i++){
		for (let j = 2; j <= 1e6 / i; j++){
			v_TF[i * j - 1] = false;
		}
	}
	let v_prime = [];
	for (let i = 1; i < v_TF.length; i++){
		if (v_TF[i]) v_prime.push(i + 1);
	}
	const lowerBound = (arr, n) => {
		let first = 0, last = arr.length - 1, middle;
		while (first <= last) {
			middle = 0 | (first + last) / 2;
			if (arr[middle] < n) first = middle + 1;
			else last = middle - 1;
		}
		return first;
	}

	//calculate saishokobaisu
	let v_howManyTimes = Array.from({length: v_prime.length}, () => 0);
	let tmp;
	let arr_soinsu = Array.from({length: N}, () => []);
	whole_loop:
	for (let i = 0; i < N; i ++){
		tmp =  v_A[i];
		for (let j = 0; j < v_prime.length; j++){
			let count = 0;
			if (v_TF[tmp - 1]) { // check whether tmp is prime number
				arr_soinsu[i].push([tmp, 1])
				v_howManyTimes[lowerBound(v_prime, tmp)] = Math.max(v_howManyTimes[j], 1);
				continue whole_loop;
			} 
			while (tmp % v_prime[j] === 0){
				tmp /= v_prime[j];
				count ++;
			}
			if (count !== 0) arr_soinsu[i].push([v_prime[j], count]);
			v_howManyTimes[j] = Math.max(v_howManyTimes[j], count);
			if (tmp === 1) continue whole_loop;
		}
	}

	let P = 1;
	for (let i = 0; i < v_prime.length; i ++){
		for (let j = 1; j <= v_howManyTimes[i]; j ++){
			P = kakeruR(P, v_prime[i], C, C2);
		}
	}

	//calculate inverse
	let v_INV = INV(1e6, C, C2);

	//calculate ans

	let ans = 0;
	for (let i = 0; i < N; i ++){
		tmp = P;
		// for (let j = 0; j < v_prime.length; j ++){
		// 	if (arr_soinsu[i][j] !== 0){
		// 		for (let k = 1; k <= arr_soinsu[i][j]; k ++){
		// 			tmp = kakeruR(tmp, v_INV[v_prime[j]], C, C2);
		// 		}
		// 	}
		// }
		for (let x of arr_soinsu[i]){
			for (let k = 1; k <= x[1]; k ++){
				tmp = kakeruR(tmp, v_INV[x[0]], C, C2);
			}
		}
		ans += tmp;
		ans %= C;
	}
	console.log(ans); 
}

function  INV(n, MOD, C2) { //return [0!^-1, 1!^-1, 2!^-1, ..., n!^-1]
    let inv;
    inv = [0,1];
    for (var i = 2; i <= n; i++){
        inv.push(MOD - kakeruR(inv[MOD%i], (MOD / i | 0), MOD, C2) % MOD);
    }
    return inv;
}

function kakeruR(a, b, C, C2){
    var tmpQ, tmpR, ans;
    tmpQ = (b / C2 | 0);
    tmpR = b - (tmpQ * C2);
    ans = (a * tmpQ % C) * C2 % C + (a * tmpR);
    ans %= C;
    return ans;
}

// function saishoKobai(x, y){
//     if (x < y) [x, y] = [y, x];
//     var tmp1 = x;
//     var tmp2 = y;
//     while (tmp2 != 0){
//         [tmp1, tmp2] = [tmp2, tmp1 % tmp2];
//     }
//     return (BigInt(x) * BigInt(y) / BigInt(tmp1));
// }



Main(require("fs").readFileSync("/dev/stdin", "utf8"));
