// Original C++ solution (slower):
#include<bits/stdc++.h>

#define MOD 1000000007

using namespace std;

long long int mul(long long int ans, long long int x, long long int y){

    while (y)

	{

        if (y%2)

		{

            ans = (ans * x) % MOD;

        }

        x = (x * x) % MOD;

        y >>= 1;

    }

    return ans;

}

long long int inv(long long int n)

{

    return mul(1, n, MOD-2);

}

int main()

{

    int n;

    cin >> n;

    vector<int> a(n);

    for (int i=0; i<n; i++)

	{

        cin >> a[i];

    }

    vector<int> prime(1000000, 0);

    for (int i=0; i<n; i++)

	{

        int m = a[i];

        int count = 0;

        while (m%2 == 0)

		{

            m /= 2;

            count++;

        }

        prime[2] = max(prime[2], count);

        for (int j=3; j*j<=m; j+=2)

		{

            count = 0;

            while (m%j == 0)

			{

                m /= j;

                count++;

            }

            prime[j] = max(prime[j], count);

        }

        prime[m] = max(prime[m], 1);

    }

 

    long long int lcm = 1;

    for (int i=2; i<prime.size(); i++)

	{

        if (prime[i] != 0)  lcm = mul(lcm, i, prime[i]);

    }

    long long int ans = 0;

    for (int i=0; i<n; i++)

	{

        long long m = a[i], _ans = lcm;

        int count = 0;

        while (m%2 == 0)

		{

            m /= 2;

            count++;

        }

        _ans = mul(_ans, inv(2), count);

        for (int j=3; j*j<=m; j+=2)

		{

            count = 0;

            while (m%j == 0)

			{

                m /= j;

                count++;

            }

            if (count != 0)  _ans = mul(_ans, inv(j), count);

        }

        _ans = mul(_ans, inv(m), 1);

        ans += _ans;

        ans %= MOD;

    }

    cout << ans << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
// writer: w33z8kqrqk8zzzx33

#include <bits/stdc++.h>

using namespace std;



#define iter(i, a, b) for(int i=(a); i<(b); i++)

#define rep(i, a) iter(i, 0, a)

#define rep1(i, a) iter(i, 1, (a)+1)

#define log(a) cerr<<"\033[32m[DEBUG] "<<#a<<'='<<(a)<<" @ line "<<__LINE__<<"\033[0m"<<endl

#define all(a) a.begin(), a.end()

#define fi first

#define se second

#define pb push_back

#define mp make_pair



using ll=long long;

using pii=pair<int, int>;

//#define int ll

const int MOD = 1000000007;



int aray[10004], gcdForw[10004], gcdBack[10004];



int qpow(int base, int expo) {

	if(expo == 0) return 1;

	if(expo == 1) return base;

	ll v = qpow(base, expo>>1);

	v = (v * v % MOD);

	if(expo&1) v = (v * base % MOD);

	return v;

}



int modinv(ll val) {

	return qpow(val%MOD, MOD-2);

}



int mx[1000006];



signed main() {

	ios_base::sync_with_stdio(false); cin.tie(0);

	int N; cin >> N;

	ll lcm = 1;

	rep(i, N) {

		cin >> aray[i];

		int x = aray[i];

		for(int v=2; v*v<=x; v++) {

			if(x%v) continue;

			int cur = 0;

			while(x%v == 0) {

				cur++;

				x /= v;

			}

			mx[v] = max(mx[v], cur);

		}

		if(x != 1) mx[x] = max(mx[x], 1);

	}

	rep(i, 1000006) {

		if(mx[i]) lcm = (lcm * qpow(i, mx[i])) % MOD;

	}

	ll su = 0;

	rep(i, N) su = (su + lcm * modinv(aray[i])) % MOD;

	cout << su << endl;

}


// Fastest known solution for this problem: