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

typedef long long ll;
#define pa pair<int, int> 
#define pal pair<long long, long long>
#define pali pair<long long, int>
#define pad pair<double, double>
#define pb push_back
#define mp make_pair 
#define VIN(v) for(int64_t i=0;i<(v).size();i++){cin >> (v).at(i);}
#define COUT(v) for(int64_t i=0;i<(v).size();i++){ cout << v.at(i) << endl;}
#define FOR(n) for(int64_t i=0;i<n;i++)

typedef vector<bool> bvec;
typedef vector<int> ivec;
typedef vector<long long> lvec;
typedef vector<double> dvec;
typedef vector<pa> pavec;
typedef vector<pali> palivec;
typedef vector<pal>palvec;


typedef vector< vector<bool> > bmat;
typedef vector< vector<int> > imat;
typedef vector< vector<long long> > lmat;

typedef vector<string> svec;
typedef vector< vector<string> > smat;
const ll infll = (1LL << 60) - 1;
const int inf = (1 << 30) - 1;

ll gcd(ll x, ll y){
    ll r = x%y;
    if(r == 0) return y;
    else return gcd(y, r);
} 

ll lcm(ll x, ll y){
    return x*y/gcd(x,y);
}

lvec mfactor(ll n){
    bvec ip(n, true);
    lvec mf(n, -1);
    ip[0]=false; ip[1]=false; mf[0]=0; mf[1]=1;
    FOR(n){
        if(ip[i]){
            mf[i] = i;
            for(ll j=i*i; j<n; j+=i){
                ip[j] = false;
                if(mf[j] == -1) mf[j]=i;
            }
        }
    }
    return mf;
}

palivec get_prime(ll n, const lvec &mf){
    palivec plist;
    while(n != 1){
        int cnt=0;
        ll m=mf[n];
        while(mf[n] == m){
            cnt++;
            n/=m;
        }
        plist.pb(pali(m, cnt));
    }
    return plist;
}



palivec plcm(const palivec &x, const palivec &y){
    palivec l;
    ll nx = x.size();
    ll ny = y.size();
    ll i=0, j=0;
    if(nx==0) return y;
    if(ny==0) return x;
    while((i<=nx-1) && (j<=ny-1)){
        if(x[i].first == y[j].first) {
            l.pb(pal(x[i].first, max(x[i].second, y[j].second)));
            i++;
            j++;
        }
        else if(x[i].first < y[j].first) {
            l.pb(x[i]);
            i++;
        }
        else {
            l.pb(y[j]);
            j++;
        }
    }
    if(i <= nx-1) for (int k = i; k < nx; k++) l.pb(x[k]);
    if(j <= ny-1) for (int k = j; k < ny; k++) l.pb(y[k]);    
    return l;
}
/*
ll mod(ll a, ll n, ll r){
    ll res=1;
    while(n>0){
        if(n&1) res = res * a % r;
        a = a * a % r;
        n >>= 1;
    }
    return res;
}

ll divide(const palivec &x, const palivec &y, ll r){
    palivec l;
    ll nx = x.size();
    ll ny = y.size();
    ll i=0, j=0;
    ll res = 1;
    while((j <= ny-1)){
        if(x[i].first == y[j].first) {
            if(x[i].second != y[j].second) res = res * mod(x[i].first, x[i].second - y[j].second, r) % r;
            i++;
            j++;
        }
        else if(x[i].first < y[j].first) {
            res = res * mod(x[i].first, x[i].second, r) % r; 
            i++;
        }
    }
    for (int k = i; k < nx; k++) res = res * mod(x[k].first, x[k].second, r) % r; 


    return res;
}
*/

ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}


ll mod(const palivec &x, ll y){
    ll s=1;
    FOR(x.size()){
        int e=x[i].second;
        ll xx = x[i].first;
        ll res=1;
        while(e>0){
            if(e&1) res = res * xx % y;
            xx = (xx * xx) % y;
            e >>= 1;
        }
        s = s * res % y;
    }
    return s;
}


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    ll r=1e9+7;
    cin >> n;
    lvec a(n);
    VIN(a);
    ll ma = 0;
    FOR(n){
        ma = max(a[i], ma);
    }
    palivec l;
    vector<palivec> p;
    lvec mf = mfactor((ll)ma+1);
    FOR(n){
        palivec plist = get_prime(a[i], mf);
        p.pb(plist);
        l = plcm(plist, l);
    }
    ll modl = mod(l, r);
    ll ans=0;
    /*
    FOR(n){
        palivec d = divide(l, p[i]);
        ans += mod(d, r)%r;
    }
    */
    // FOR(n) ans += divide(l, p[i], r);

    FOR(n) ans += modl * modinv(a[i], r) % r;

    cout << ans % r << endl;
}

Measured memory_bytes: 9500