#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
long long mo = 1e9 + 7;

long long gcd(long long x, long long y) {
    long long g,l;
    g = max(x,y);
    l = min(x,y);
    long long a = g%l;
    return a==0? l : gcd(l,a);
}

long long MCM(vector<long long> &A, long long l, long long r){
    if(r-l ==1){
        return A[l]*A[r]/gcd(A[l],A[r]);
    }else{
        long long a = MCM(A, l, (r+l)/2);
        long long b = MCM(A, (r+l)/2 + 1, r);
        return a*b/gcd(a,b);
    }
}

long long Pow (long long a, long long p)
{
    if(p == 0)
        return 1;
    if(p % 2 == 0)
    {
        long long an = Pow(a, p / 2);
        return an * an % mo;
    }
    else
    {
        long long an = Pow(a, p - 1);
        return an * a % mo;
    }
}
int main(){
    long long N;
    cin >> N;
    vector<long long> A(N);
    //vector<long long> P1(1000010, 0);
    //vector<vector<long long>> P2(N, vector<long long>(1000010, 0));
    map<long long, long long> P1;
    vector<map<long long, long long>> P2(N);
    for(long long i=0; i<N; i++){
        cin >> A[i];
        long long tmp = A[i];
        for(long long j=2; j<1001;j++){
            if(j != 2 && j % 2 == 0) continue;
            while(true){
                if(tmp % j == 0){
                    tmp /= j;
                    //P2[i][j]++;
                    if(P2[i].find(j) != P2[i].end()){
                        P2[i].at(j)++;
                    }else{
                        P2[i].insert(make_pair(j,1));
                    }
                    continue;
                }else{
                    break;
                }
            }
            /*if(P1.find(j) != P1.end()){
                P1.at(j) = max(P1.at(j), P2[i].at(j));
            }else{
                P1.insert(make_pair(j,P2[i].at(j)));
            }*/
        }
        if(tmp > 1000){
            //cout << "a"<<endl;
            P2[i].insert(make_pair(tmp,1));
            /*if(P1.find(tmp) != P1.end()){
                P1.insert(make_pair(tmp,1));
            }*/
        }
        //mcm = (mcm * A[i]) / (gcd(mcm,A[i]));
        //mcm *= A[i];
    }
    for(long long i = 0; i<N;i++){
        for(auto& e:P2[i]){
            if(P1.find(e.first) != P1.end()){
                P1.at(e.first) = max(P1.at(e.first), e.second);
            }else{
                P1.insert(make_pair(e.first,e.second));
            }
        }

    }
    long long S = 1;
    for(auto& e:P1){
        rep(i,e.second) S = S*e.first%mo;
    }

    //mcm = MCM(A, 0, N-1);    
    long long mcm = 1;
    long long sum = 0;
    
    rep(i,N){
        sum += S*Pow(A[i],mo-2)%mo;
    }
    /*
    for(long long i=2;i<1001;i++){
        if(P1[i] != 0){
            mcm *= i*P1[i];
        }
    }*/
    /*
    for(long long i=0; i<N; i++){
        //long long tmp = 1;
        for(auto& e:P1){
            if(P2[i].find(e.first) == P2[i].end()){
                //cout << "bbbb" << endl;
                //long long a = (long long)((pow(double(e.first), double(P1.at(e.first)))+0.5));
                //a %= mo;
                tmp *= a;
                tmp %= mo;
                continue;
            }
            //cout << "tmp03:"<< e.first << ' '<< e.second << endl;
            if(P1.at(e.first) - P2[i].at(e.first) > 0){
                //cout << "tmp04:"<< e.first << ' '<< e.second << endl;
                //long long a = (long long)((pow(double(e.first), double(P1.at(e.first) - P2[i].at(e.first))))+0.5);
                //cout << "tmp11:" << (pow(double(j), double(P1[j] - P2[i][j]))) << endl;
                //cout << "aaaaa:" << a <<endl;
                //cout << "tmp00:"<< tmp << endl;
                //a %= mo;
                tmp *= a;
                //cout << "tmp01:"<< tmp << endl;
                //cout << "tmp02:"<< a << endl;
                tmp %= mo;
            }     
        }
        //sum += ((mcm / A[i]) % mo);
        sum += tmp;
        sum %= mo;
    }
    */

    /*rep(i,10){
        cout << A[i][i] <<' ';
    }
    cout << endl;
    */
    cout << sum%mo << endl;
}


Measured memory_bytes: 3968