#include<bits/stdc++.h>
using namespace std;
using ll = long long;

//const int mod = 998244353;
const int mod = 1000000007;


struct Sieve{
    ll n;
    vector<ll> f;
    Sieve(int n=1): n(n), f(n+1){
        f[0] = f[1] = -1;
        for(ll i=2;i<=n;i++){
            if(f[i]) continue;
            f[i] = i;
            for(ll j=i*i;j<=n;j+=i){
                if(!f[j]) f[j] = i;
            }
        }
    }

    bool isPrime(ll x){return f[x]==x;}

    //素因数分解
    vector<int> factorlist(int x){
        vector<int> primelist;
        int nx=x;
        while(nx!=1){
            primelist.push_back(f[nx]);  //xの最小の素因数
            nx /= f[nx];
        }
        
        /*
        if(output){                  //出力付き
            cout << x << " = ";
            for(int i=0;i<primelist.size();i++){
                if(i!=primelist.size()-1) cout << primelist[i] << "*";
                else cout << primelist[i] << endl;
            }
        }
        */
        return primelist;
    }

    vector<pair<int,int>> factornum(int x){
        //vector<int> fl = factorlist(x,false);
        vector<int> fl = factorlist(x);
        if(fl.size()==0) return {};
        vector<pair<int,int>> vec(1,make_pair(fl[0],0));
        for(int p : fl){
            if(vec.back().first==p){
                vec.back().second++;
            }else{
                vec.emplace_back(p,1);
            }
        }
        /*
        if(output){
            cout << x << " = ";
            for(int i=0;i<vec.size();i++){
                if(i!=vec.size()-1) cout << vec[i].first << "^" << vec[i].second << " * ";
                else cout << vec[i].first << "^" << vec[i].second << endl;
            }
        }
        */

        return vec;
    }


};


struct mint {
  ll x;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  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 { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= 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 { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main(void){
    Sieve sieve(1000005);
    int n;
    cin >> n;
    vector<int> vec(n);
    for(int i=0;i<n;i++) cin >> vec[i];

    map<int,int> mp;
    for(int i=0;i<n;i++){
        vector<pair<int,int>> f = sieve.factornum(vec[i]);
        for(auto p: f){
            mp[p.first] = max(mp[p.first],p.second);
        }
    }

    mint lcm = 1;
    for(auto p: mp){
        for(int i=0;i<p.second;i++) lcm *= p.first; 
    }
    mint ans=0;
    for(int i=0;i<n;i++) ans += lcm/vec[i];
    cout << ans << endl;

}

Measured memory_bytes: 8576