#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;


#define MAXN 150000			// total # of prime numbers
#define MAXP 1001002		// highest number to test prime

int prime[MAXN];		// prime numbers: 2, 3, 5 ...
int lp[MAXP];		// lp[n] = n if n is prime; otherwise smallest prime factor of the number
int phi[MAXP];			// phii function

class prime_class {
public:
	long top;

	prime_class() {			// generate all prime under MAXP
		int i, i2, j;

		top = 0;
		lp[0] = 0;
		lp[1] = 1;
		for (i = 2; i < MAXP; i++) lp[i] = 0;

		top = 0;
		for (i = 2; i < MAXP; ++i) {
			if (lp[i] == 0) {
				lp[i] = i;
				prime[top++] = i;
			}
			for (j = 0; (j < top) && (prime[j] <= lp[i]) && (i * prime[j] < MAXP); ++j)
				lp[i * prime[j]] = prime[j];
		}
	}

	bool isprime(long long key)
	{
		if (key < MAXP)	return (lp[key] == key) && (key >= 2);
		else {
			int i;
			for (i = 0; (i < top) && (prime[i] * prime[i] <= key); i++)
				if (key % prime[i] == 0) return false;
			return true;
		}
	}

	unordered_map<int, int> factorize(int key) {
		unordered_map<int, int> ans;

		while (lp[key] != key) {
			ans[lp[key]]++;
			key /= lp[key];
		}
		if (key > 1) ans[key]++;

		return ans;
	}

	int get_phi(int key) {	// calculate Euler's totient function, also known as phi-function
		int ans = key, last = 0;

		while (lp[key] != key) {
			if (lp[key] != last) {
				last = lp[key];
				ans -= ans / last;
			}
			key /= lp[key];
		}
		if ((key > 1) && (key != last)) ans -= ans / key;

		return ans;
	}

	void calc_all_phi(int n) {
		int i, j, k;
		for (int i = 1; i < n; i++) phi[i] = i;
		for (int i = 2; i < n; i++) {
			if (phi[i] == i) {
				for (int j = i; j < n; j += i) {
					phi[j] /= i;
					phi[j] *= i - 1;
				}
			}
		}
	}

	vector<pair<long long, long long>> factorize_full(long long key) {		// can be used to factorize numbers >= MAXP
		vector<pair<long long, long long>> ans;

		long i, ct;

		for (i = 0; (i < top) && (prime[i] <= key); i++)
			if (key % prime[i] == 0) {
				ct = 0;
				while (key % prime[i] == 0) {
					ct++;
					key /= prime[i];
				}
				ans.push_back({ prime[i], ct });
			}
		if (key > 1) {
			ans.push_back({ key, 1 });
		}
		return ans;
	}

	void generate_divisors(int step, int v, vector<pair<int, int>>& fp, vector<int>& ans) {
		if (step < fp.size()) {
			generate_divisors(step + 1, v, fp, ans);
			for (int i = 1; i <= fp[step].second; i++) {
				v *= fp[step].first;
				generate_divisors(step + 1, v, fp, ans);
			}
		}
		else ans.push_back(v);
	}

	void generate_divisors_full(long long step, long long v, vector<pair<long long, long long>>& fp, vector<long long>& ans) {
		if (step < fp.size()) {
			generate_divisors_full(step + 1, v, fp, ans);
			for (int i = 1; i <= fp[step].second; i++) {
				v *= fp[step].first;
				generate_divisors_full(step + 1, v, fp, ans);
			}
		}
		else ans.push_back(v);
	}

	vector<int> get_divisors(int key) {
		unordered_map<int, int> f = factorize(key);
		int n = f.size();
		vector<pair<int, int>> fp;
		for (auto p : f) fp.push_back(p);
		vector<int> ans;
		generate_divisors(0, 1, fp, ans);
		return ans;
	}

	vector<long long> get_divisors_full(long long key) {
		vector<pair<long long, long long>> f = factorize_full(key);
		int n = f.size();
		vector<pair<long long, long long>> fp;
		for (auto p : f) fp.push_back(p);
		vector<long long> ans;
		generate_divisors_full(0, 1, fp, ans);
		return ans;
	}


};



long long mul_inv(long long a, long long b)
{
	long long b0 = b, t, q;
	long long x0 = 0, x1 = 1;
	if (b == 1) return 1;
	while (a > 1) {
		q = a / b;
		t = b, b = a % b, a = t;
		t = x0, x0 = x1 - q * x0, x1 = t;
	}
	if (x1 < 0) x1 += b0;
	return x1;
}

long long division(long long a, long long b, long long p) {		// (a / b) mod p = ((a mod p) * (b^(-1) mod p)) mod p
	long long ans, inv;
	inv = mul_inv(b, p);
	ans = ((a % p) * inv) % p;
	return ans;
}

long long gcd(long long a, long long b)
{
	while (b != 0) {
		long long t = b;
		b = a % b;
		a = t;
	}
	return a;
}

long long lcm(long long a, long long b, long long p) {		// (a / b) mod p = ((a mod p) * (b^(-1) mod p)) mod p
	long long ans, g;
	g = gcd(a, b);
	b /= g;
	ans = (a * b) % p;
	//ans = division(ans, g, p);

	return ans;
}

#define MOD 1000000007LL

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	long long n, i, j, k, ans, g, l, key;
	cin >> n;
	vector<long long> a(n), b(n);
	vector<int> ct(1000100, 0);

	prime_class pr;

	for (i = 0; i < n; i++) {
		cin >> a[i];
		unordered_map<int, int> f = pr.factorize(a[i]);

		for (auto p : f) ct[p.first] = max(ct[(int)p.first], (int)p.second);
	}

	l = 1;
	for (i = 1; i < 1000100; i++) {
		for (j = 0; j < ct[i]; j++) l = (l * i) % MOD;
	}

	ans = 0;
	for (i = 0; i < n; i++) {
		b[i] = division(l, a[i], MOD);
		ans = (ans + b[i]);
	}

	ans %= MOD;
	cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 10616