// E - Flatten

// 素因数分解を高速化

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct ModInt {
	long long val;
	constexpr ModInt(long long v = 0) noexcept : val(v % MOD) {
		if (val < 0) val += MOD;
	}
	constexpr int getmod() { return MOD; }
	constexpr ModInt operator - () const noexcept {
		return val ? MOD - val : 0;
	}
	constexpr ModInt operator + (const ModInt& r) const noexcept { return ModInt(*this) += r; }
	constexpr ModInt operator - (const ModInt& r) const noexcept { return ModInt(*this) -= r; }
	constexpr ModInt operator * (const ModInt& r) const noexcept { return ModInt(*this) *= r; }
	constexpr ModInt operator / (const ModInt& r) const noexcept { return ModInt(*this) /= r; }
	constexpr ModInt& operator += (const ModInt& r) noexcept {
		val += r.val;
		if (val >= MOD) val -= MOD;
		return *this;
	}
	constexpr ModInt& operator -= (const ModInt& r) noexcept {
		val -= r.val;
		if (val < 0) val += MOD;
		return *this;
	}
	constexpr ModInt& operator *= (const ModInt& r) noexcept {
		val = val * r.val % MOD;
		return *this;
	}
	constexpr ModInt& operator /= (const ModInt& r) noexcept {
		long long a = r.val, b = MOD, u = 1, v = 0;
		while (b) {
			long long t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % MOD;
		if (val < 0) val += MOD;
		return *this;
	}
	constexpr bool operator == (const ModInt& r) const noexcept {
		return this->val == r.val;
	}
	constexpr bool operator != (const ModInt& r) const noexcept {
		return this->val != r.val;
	}
	friend constexpr ostream& operator << (ostream &os, const ModInt<MOD>& x) noexcept {
		return os << x.val;
	}
	friend constexpr ModInt<MOD> modpow(const ModInt<MOD> &a, long long n) noexcept {
		if (n == 0) return 1;
		auto t = modpow(a, n / 2);
		t = t * t;
		if (n & 1) t = t * a;
		return t;
	}
};

const int MOD = 1000000007;
using mint = ModInt<MOD>;

class FastPF {
private:
	vector<int> primes;
	vector<bool> isprime;
	vector<int> min_factor;
public:
	FastPF(int MAX) : primes(), isprime(MAX+1, true), min_factor(MAX+1, -1) {
		isprime[0] = isprime[1] = false;
		min_factor[0] = 0, min_factor[1] = 1;
		for (int i = 2; i <= MAX; ++i) {
			if (!isprime[i]) continue;
			primes.push_back(i);
			min_factor[i] = i;
			for (int j = i*2; j <= MAX; j += i) {
				isprime[j] = false;
				if (min_factor[j] == -1) min_factor[j] = i;
			}
		}
	}

	// prime factorization
	vector<pair<int,int>> prime_factorize(int n) {
		vector<pair<int,int>> res;
		while (n != 1) {
			int prime = min_factor[n];
			int exp = 0;
			while (min_factor[n] == prime) {
				++exp;
				n /= prime;
			}
			res.push_back(make_pair(prime, exp));
		}
		return res;
	}
};

int A[10000];
map<ll, ll> lcm_pf;

int main() {
	int N;
	cin >> N;

	FastPF fpf(1000000);

	for (int i=0; i<N; i++) {
		cin >> A[i];
		auto A_pf = fpf.prime_factorize(A[i]);
		for (auto p : A_pf) {
			ll e = p.first;
			ll c = p.second;

			if (c > lcm_pf[e]) lcm_pf[e] = c;
		}
	}

	mint lcm = 1;
	for (auto itr : lcm_pf) {
		mint e = itr.first;
		ll c = itr.second;
		lcm *= modpow(e, c);
	}

	mint ans = 0;
	for (int i=0; i<N; i++) {
		ans += lcm / A[i];
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 5240