#include <bits/stdc++.h>
#define ll long long
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
using namespace std;
const int tINF = (int)INT_MAX;
const long long lINF = (long long)LLONG_MAX;
const long long mod = (long long) 1e9 + 7LL;
ll binPow(ll a, ll n){
    if(n == 0) return 1;
    if((n & 1)) return (a * binPow(a,n - 1)) % mod;
    else {
        ll bRes = binPow(a, n >> 1) % mod;    
        return bRes * bRes % mod;
    } 
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifdef DEBUG
			assert(freopen("inp", "r", stdin));
			assert(freopen("out", "w",stdout));
	#else
			#define cerr if(false)cerr
	#endif
    vector <int> primes;
    ll mxN = (int)1e6;
    vector <char> isPrime(mxN + 1,1);
    for(ll i = 2; i * i<= mxN; ++i){
        if(isPrime[i] == 1){
            primes.push_back(i);
            for(ll j = i * i; j <= mxN; j += i){
                isPrime[j] = 0;
            }
        }
    }
    //for(auto i : primes)
        //cout << i << " ";
    //return 0;
    int n;
    cin >> n;
    vector <ll> ar(n);
    map <int,int> lcp;
    for(auto &i : ar)
        cin >> i;
    for(auto i : ar){
        int z = i;
        for(auto j : primes){
            int  cnt = 0; 
            while(z % j == 0){
                ++cnt;
                z /= j;
            }
            lcp[j] = max(lcp[j],cnt);
            if(j > z)
                break;
        }
        if(z > 1)
            lcp[z] = max(lcp[z],1);
    }
    //for(auto [num,cnt] : lcp){
        //cout << num << " " << cnt << '\n';
    //}
    ll ans = 0;
    map <ll,ll> comp;
    ll lcm = 1;
    for(auto i : lcp) {
        ll num = i.first;
        ll cnt = i.second;
        lcm *= binPow(num,cnt);
        lcm %= mod;
    }
    for(auto curNum : ar){
        ans += (lcm * binPow(curNum,mod - 2)) % mod;
        ans %= mod;
    }
    /*
    for(auto curNum : ar){
        int z = curNum;
        if(comp.find(curNum) != comp.end()){
            ans += comp[curNum];
            ans %= mod;
            continue;
        }
        ll num = 1;
        // two pointer map iteration
        auto it = lcp.begin(); 
        for(int g = 0; g < (int)primes.size(); ++g){
            int j = primes[g]; 
            int  cnt = 0; 
            while(z % j == 0){
                ++cnt;
                z /= j;
            }
            if(cnt == 0)
                continue;
            while(it != lcp.end() && (*it).first != j){
                num *= binPow((*it).first, (*it).second) % mod;
                num %= mod;
                ++it;
            }
            num *= binPow(j, lcp[j] - cnt);
            num %= mod;
            ++it;
            if(j > z)
                break;
        }
        if(z > 1){
            while(it != lcp.end() && (*it).first != z){
                num *= binPow((*it).first, (*it).second) % mod;
                num %= mod;
                ++it;
            }
            num *= binPow(z, lcp[z] - 1);
            num %= mod;
            ++it;

        }
        while(it != lcp.end()){
            num *= binPow((*it).first, (*it).second) % mod;
            num %= mod;
            ++it;
        }
        comp[curNum] = num;
        ans += num;
        ans %= mod;
    }*/
    cout << ans << '\n';
    cerr << "Time execute: " << (double)clock() / (double)CLOCKS_PER_SEC 
    << " sec" << endl;
}

Measured memory_bytes: 1792