#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <set>
#include <assert.h>
#include <sstream>
#include <string>
//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater <>())
#define rn return
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
using namespace std;
using ll = long long;
typedef std::pair<int,int> P;
 
 
 
 
 
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
    ll x; // typedef long long ll;
    mint(ll x=0):x((x%mod+mod)%mod){}
    
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    
    // for prime mod
    mint inv() const {
        return pow(mod-2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res/=a;
    }
};
// combination mod prime
struct combination {
    vector<mint> fact, ifact;
    combination(int n):fact(n+1),ifact(n+1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n]*ifact[k]*ifact[n-k];
    }
};
 
 
 
 
 const int mx = 1001001;
 vector<int> isPrime(mx,1);
 vector<int> from(mx,-1);
 
 void sieve(){
    FOR(i,2,mx + 1){
        if (isPrime[i] == 0) continue;
        else{
            for(int j = 2*i; j <= mx; j+=i){
                isPrime[j] = 0;
                from[j] = i;
            }
        }
    }    
 }
 
 int main(){
    int n;
    cin >> n;
    sieve();
    vector<int> a(n);
    map<int,int> lcm;
    rep(i,n) cin >> a[i];
    rep(i,n){
        int m = a[i];
        map<int,int> primes;
        while(isPrime[m] != 1){
            primes[from[m]]++;
            m /= from[m];
        }
        if(m!=1) primes[m]++;
        map<int,int>:: iterator it = primes.begin();
        while(it!= primes.end()){
            lcm[it->first] = max(lcm[it->first],it->second);
            it++;
        }
    }
    map<int,int>:: iterator it = lcm.begin();
    mint LCM = 1;

    while(it!=lcm.end()){
        rep(i,it->second){
            LCM*=(it->first);
        }
        it++;
    }
    mint ans = 0;
    rep(i,n){
        ans += LCM/a[i];
    }
    cout << ans.x;
 }

Measured memory_bytes: 8576