// Slower C++ solution:
/*|In The Name Of Allah|*/

//This Month Will Be Expert ISA

#include <bits/stdc++.h>



using namespace std;



const int N = 1e6+7;



const int mod = 1e9+7;



int n;

int ar[N];



vector < int > primeFactors(long long num){

    vector < int > prm;

    while (num % 2 == 0){

        prm.push_back(2);

        num = num/2;

    }

    for (long long i = 3; i*i <= num; i = i + 2){

        while (num % i == 0){

            prm.push_back(i);

            num = num/i;

        }

    }

    if (num > 2)

        prm.push_back(num);

    return prm;

}



int mxF[N];



int fastP(int b, int e){

    if(!e)

        return 1;

    if(e & 1)

        return b * 1ll * fastP(b * 1ll * b % mod, e >> 1) % mod;

    return fastP(b * 1ll * b % mod, e >> 1) % mod;

}



int main(){

    scanf("%d" , &n);

    for(int i = 1; i <= n; i++){

        scanf("%d" , &ar[i]);

        map < int , int > cntF;

        vector < int > prmF = primeFactors(ar[i]);

        for(auto v : prmF){

            cntF[v]++;

        }

        for(auto v : cntF){

            mxF[v.first] = max(mxF[v.first] , v.second);

        }

    }

    int sum = 0;

    long long LCM = 1;

    for(int i = 1; i <= 1e6; i++){

        while(mxF[i]--){

            LCM = LCM * i % mod;

        }

    }

    for(int i = 1; i <= n; i++){

        sum = (sum + LCM * fastP(ar[i] , mod - 2)) % mod;

    }

    printf("%d\n" , sum);

}


// Faster C++ solution for the same problem (measured speedup: 5.943237956656581x):
#include <bits/stdc++.h>



using namespace std;



#define endl "\n"

#define ll long long

#define ld long double

#define ull unsigned long long

#define forn(i, n) for (int i = 0; i < (int)(n); ++i)

#define for1n(i, n) for (int i = 1; i < (int)(n); ++i)

#define forln(i, n) for (long long i = 0; i < (long long)(n); ++i)

#define forl1n(i, n) for (long long i = 1; i < (long long)(n); ++i)



const ld EPS = 1e-9;

#define mod 1000000007



ll GetMod(ll n, ll z) { // func to get mod for positive num and negitive nums

    return (n % z + z) % z;

}



//          U   R  D  L

int dx[] = {-1, 0, 1, 0, -1, +1, +1, -1}; // dx for the 8 adjacent places in matrix

int dy[] = {0, 1, 0, -1, +1, +1, -1, -1};// dy for the 8 adjacent places in matrix



map<ll, ll> m;



ll fp(ll base, ll exp) {

    if (exp == 0)

        return 1;

    ll ans = fp(base, exp / 2);

    ans = (ans * ans) % mod;

    if (exp % 2 != 0)

        ans = (ans * (base % mod)) % mod;

    return ans;

}



void GetPrime(ll a) {

    map<ll, ll> m1;



    for (ll i = 2; i * i <= a; i++) {

        while (a % i == 0) {

            m1[i]++;

            a /= i;

        }

    }

    if (a > 1)m1[a]++;





    for (auto s = m1.begin(); s != m1.end(); s++) {

        ll dig = s->first;

        ll poww = s->second;

        if (m[dig] != 0) {

            m[dig] = max(poww, m[dig]);



        } else {

            m[dig] = poww;



        }



    }





}



ll GetLCM() {

    ll ans = 1;

    for (auto s = m.begin(); s != m.end(); s++) {

        ans = (ans * fp(s->first, s->second)) % mod;

    }

    return ans;

}



vector<ll> v;



int main() {



    ios_base::sync_with_stdio(false), cin.tie(NULL);

    ll n;

    cin >> n;

    v.resize(n);

    forn(i, n)cin >> v[i];

    forn(i, n) {

        GetPrime(v[i]);

    }

    ll res = GetLCM();





    ll sum = 0;

    forn(i, n) {

        ll z = (res * fp(v[i], mod - 2)) % mod;



        sum = (sum + z) % mod;

    }

    cout << sum;



}