/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
//#include <unordered_set> //unordered_set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
#define endl "\n";
using namespace std;

const long long INF = 4000000000000000001;
const int inf = 1001001001;
const int MOD = 1000000007;
typedef pair<long long,long long> P;

//Solve N^M. This, mod_pow use Iterative Square Method.
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //最下位ビット(*N)が1の時は単独でNをかける
    if (M & 1) res = (res * N) % MOD;
    return res %= MOD;
}
long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
    return a / gcd(a, b) * b ;
}

vector<long long> sum_prime_factor(1000005);
vector<map<long long,long long>> each_prime_factor;

int main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
 
    int N;cin >> N;
    vector<long long> A(N);
    for(int i = 0;i<N;i++) cin >> A.at(i);
    //素因数分解する O(N*√N)
    for(int i = 0;i<N;i++){
        map<long long,long long> prime_factor;
        long long now = A.at(i);
        while(true){
            long long prv = now;
            for(long long j = 2;j<=sqrt(now)+1;j++){
                if(now % j == 0){
                    prime_factor[j]++;
                    now /= j;
                    break;
                }
            }
            if(now == prv){
                prime_factor[now]++;
                break;
            }
        }
        each_prime_factor.push_back(prime_factor);
        for(auto M : prime_factor){
            if(sum_prime_factor.at(M.first) < M.second){
                sum_prime_factor.at(M.first) = M.second;
            }
        }
    }
    //map<long long,long long> lcm_prime_factor;
    long long LCM = 1;
    for(long long i = 0;i<1000005;i++){
        if(sum_prime_factor.at(i) == 0) continue;
        LCM *= mod_pow(i,sum_prime_factor.at(i));
        LCM %= MOD;
    }
    long long ans = 0;
    for(int i = 0;i<N;i++){
        long long now = LCM;
        /*
        LCM / B = LCM * mod_pow(B,MOD-2) である
        */
        now *= mod_pow(A.at(i),MOD-2);
        now %= MOD;
        ans += now;
        ans %= MOD;
    }
    /*//lcmから答えを計算する。O(NlogN*(含まれる素因数の数))
    for(int i = 0;i<N;i++){
        long long plus = 1;
        for(auto M : lcm_prime_factor){
            plus *= mod_pow(M.first,M.second-each_prime_factor.at(i)[M.first]);
            plus %= MOD;
        }
        ans += plus;
        ans %= MOD;
    }*/
    cout << ans << endl;
}

Measured memory_bytes: 14760