#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define fi                      first
#define se                      second
#define pb                      push_back
#define pbb                     pop_back
#define mp                      make_pair
#define pii     	            pair<int,int>
#define all(x)                  x.begin(), x.end()
#define mem(array, value)       memset(array, value, sizeof(array))
#define fastRead 	            ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#ifdef Lollipop
    #define line                    cout << "\n===================\n"
    #define trace(...)              __f( #__VA_ARGS__ , __VA_ARGS__ )
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cerr << name << " = " << arg1 << "\n";
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ',');
        cerr.write(names, comma - names) << " = " << arg1 << " , ";
    __f(comma + 1, args...);
    }
#else
    #define line
    #define trace(...)
#endif

ll ext_gcd(ll A, ll B, ll *X, ll *Y ){
    ll x2, y2, x1, y1, x, y, r2, r1, q, r;
    x2 = 1, y2 = 0;
    x1 = 0, y1 = 1;
    for (r2 = A, r1 = B; r1 != 0; r2 = r1, r1 = r, x2 = x1, y2 = y1, x1 = x, y1 = y ) {
        q = r2 / r1, r = r2 % r1;
        x = x2 - (q * x1), y = y2 - (q * y1);
    }
    *X = x2; *Y = y2;
    return r2;
}
inline ll mod_inv(ll a, ll m){
    ll x, y;
    ext_gcd(a, m, &x, &y);
    x %= m;
    if ( x < 0 ) x += m;
    return x;
}
inline ll big_mod(ll a, ll p, ll m){
    ll res = 1 % m, x = a % m;
    while (p){
        if (p & 1) res = (res * x) % m;
        x = (x * x) % m, p >>= 1;
    }
    return res;
}

const int mod = 1e9 + 7;
const int nax = 1e6 + 5;
int ara[nax];
vector<int> primes;
bool sieve[nax];
map<int, int> lcm_factors;
int n;
int sz;

void prime_fact(int num)
{
    int sqrtN = sqrt(num);
    for (int i = 0; i < sz && primes[i] <= sqrtN; i++){
        if (num % primes[i] == 0){
            int cnt = 0;
            while (num % primes[i] == 0){
                num /= primes[i];
                cnt++;
            }
            sqrtN = sqrt(num);
            lcm_factors[primes[i]] = max(cnt, lcm_factors[primes[i]]);
        }
    }
    if (num != 1){
        lcm_factors[num] = max(1, lcm_factors[num]);
    }
}

void pre_cal()
{
    int N = 1e6;
    int sqrtN = sqrt(N);
    for (int i = 3; i <= sqrtN; i += 2){
        if (!sieve[i]){
            for (int j = i * i; j <= N; j += 2 * i){
                sieve[j] = true;
            }
        }
    }
    primes.pb(2);
    for (int i = 3; i <= N; i++){
        if (!sieve[i]){
            primes.pb(i);
        }
    }
    sz = primes.size();
    for (int i = 0; i < n; i++){
        prime_fact(ara[i]);
    }
}

int main ()
{
    #ifdef Lollipop
        freopen ("input.txt", "r", stdin);
        //freopen ("output.txt", "w", stdout);
    #endif
    //fastRead;
    cin >> n;
    for (int i = 0; i < n; i++){
        cin >> ara[i];
    }
    pre_cal();
    ll lcm = 1;
    for (auto it : lcm_factors){
        lcm = (lcm * big_mod(it.fi, it.se, mod));
        lcm %= mod;
    }
    ll sum = 0;
    for (int i = 0; i < n; i++){
        sum += lcm * mod_inv(ara[i], mod);
        sum %= mod;
    }
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 7280