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

using ll = long long;

constexpr ll MOD = 1e9+7;
constexpr ll INF = 1ll<<60;

#define FOR(i,a,b) for (ll i=(a);i<(ll)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

ll gcd(ll a, ll b)
{
	if (b == 0) return a;
	else return gcd(b, a%b);
}

ll lcm(ll a, ll b)
{
	return a*b/gcd(a, b);
}

struct Eratos
{
	vector<ll> primes;
	vector<bool> isprime;
	vector<ll> min_factor;

	Eratos(ll 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 (ll i = 2; i <= MAX; ++i)
		{
			if(!isprime[i]) continue;
			primes.push_back(i);
			min_factor[i] = i;
			for (ll j = i*2; j <= MAX; j += i)
			{
				isprime[j] = false;
				if (min_factor[j] == -1) min_factor[j] = i;
			}
		}
	}

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

template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& 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 Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<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;
    }
};

using mint = Fp<MOD>;

int main(int argc, char **argv)
{
	ll N; cin >> N;
	vector<ll> A(N); REP(i, N) cin >> A[i];
	ll A_MAX = 1000010;

	vector<ll> num(A_MAX, 0);
	Eratos e(A_MAX);

	for (ll i = 0; i < N; ++i)
	{
		auto vp = e.prime_factorize(A[i]);
		for (auto p : vp) num[p.first] = max(num[p.first], p.second);
	}

	mint l{1};
	for (ll v = 2; v < A_MAX; ++v)
	{
		l *= modpow(mint(v), num[v]);
	}

	mint res{0};
	for (auto a : A)
		res += l/a;

	std::cout << res << std::endl;
}


Measured memory_bytes: 17272