#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;

const long long MOD = 1000000007;

ll gcd (ll a, ll b){ return b == 0? a : gcd(b, a % b); }
ll lcm (ll a, ll b){ return a * (b / gcd(a, b));}

ll extgcd(ll a, ll b, ll &x, ll &y){
    if(b == 0){
        x = 1; y = 0;
        return a;
    }
    ll d = extgcd(b, a % b, y, x);
    y -= (a / b) * x;
    return d;
}

//* calculate a^-1 mod m
ll mod_inverse(ll a, ll m){
    ll x, y;
    extgcd(a, m, x, y);
    return(m + x%m) % m;
}
//* calculate primes using sieve
ll sieve(ll n, vll &prime, vector<bool> &isprime){
    //* return the number of primes <= n
    //* prime[0]~ prime[p-1] record the primes
    //* isprime[0] ~ isprime[n] records the sieve
    ll p = 0;
    rep(i, n+1)
        isprime[i] = true;
    isprime[0] = isprime[1] = false;
    //* i==2 check
    prime[p++] = 2;
    for(ll j= 2*2; j <= n; j+= 2)
        isprime[j] = false;
    //* i>=3 check
    for(ll i=3; i <= n; i++){
        if(isprime[i]){
            prime[p++] = i; 
            for(ll j= 2*i; j <= n; j+= i)
                isprime[j] = false;
        }
    }
    return p;
}

//* prime factorization in O(sqrt(n))
map<ll, ll> prime_factor(ll n){
    map<ll, ll> res;
    for(ll i=2; i*i <= n; i++){ //* n shrinks during the for-loop!
        while(n % i == 0){
            ++res[i];
            n /= i;
        }
    }
    if(n != 1) {
        ++res[n];
    }
    return res;
}

//* prime factorization in O(faster) using prime vector
map<ll, ll> prime_factor(ll n, vll &prime){
    map<ll, ll> res;
    for(auto p: prime){
        if(p*p > n)
            break;
        while(n % p == 0){
            ++res[p];
            n /= p;
        }
        if(n == 1)
            break;
    }

    if(n != 1) {
        ++res[n];
    }
    return res;
}

void solve(long long N, std::vector<long long> A){
    ll MAXA=0; REP(i, N) MAXA = max(MAXA, A[i]);
    vb isprime(MAXA+1); vll prime(80000);
    ll num_prime = sieve(MAXA, prime, isprime);
    //prime.resize(num_prime);
    map<ll, ll> pmap;
/*
    for(auto p: prime){
        ll cnt = 0;
        bool update = false;
        REP(i, N){
            ll tmp = 0;
            if(B[i] > 1) update = true;
            while(B[i] % p == 0){
                tmp++;
                B[i]/=p;
            }
            
            cnt = max(cnt, tmp);
        }
        if(cnt > 0){
            pmap[p] = cnt;
        }
        if(!update)
            break;
        
    }
*/
    vector<map<ll,ll>> pmap_rec;
    REP(i, N){
        auto tmp_map = prime_factor(A[i], prime);
        pmap_rec.push_back(tmp_map);
        for(auto x: tmp_map){
            if(pmap.count(x.first)){
                pmap[x.first] = max(pmap[x.first], x.second);
            }
            else{
                pmap[x.first] = x.second;
            }
        }
    }
    
    ll ans = 0;
    ll lcm_a = 1;
    for(auto x: pmap){
        REP(i, x.second){
            lcm_a = (lcm_a * x.first) % MOD;
        }
    }

    REP(i, N){
        auto tmp_map = pmap_rec[i];
        ll tmp = lcm_a;
        for(auto x: tmp_map){
            ll a = mod_inverse(x.first, MOD);
            REP(i, x.second){
                tmp = (tmp * a) % MOD;
            }
        }
        ans = (ans + tmp) %MOD;
    }
    /*
    REP(i, N){
        ll tmp = 1;
        for(auto x: pmap){
            ll prm = x.first, cnt = x.second;
            while(A[i]%prm == 0 && A[i]>0){
                A[i]/=prm;
                cnt--;
            }
            REP(j, cnt){
                tmp = (tmp*prm) % MOD;
            }
        }
        ans = (ans + tmp) % MOD;
    }
    */
    cout<<ans<<endl;
    return;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 4536