#pragma GCC optimize("Ofast")
#include <cstdio>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
using namespace std;
#define INF 1LL << 61
#define MAX 1LL << 30
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,int> P;
//typedef pair<pair<int,int>,int> p;
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)
struct edge{ll to,cost,val;};
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());
//#define int ll
int dx[]={1,-1,0,0},dy[]={0,0,-1,1};

struct ModInt{
    ll a;
    ModInt() : a(0) {}
    ModInt(ll x) {
        x%=MOD;
        if(x<0) x+=MOD;
        a=x;
    }

    ModInt operator+=(const ModInt p){
        a+=p.a;
        if( a>=MOD ) a-=MOD;
        return *this;
    }
    ModInt operator-=(const ModInt p){
        a-=p.a;
        if(a<0) a+=MOD;
        return *this;
    }
    ModInt operator*=(const ModInt p){
        a=(a*p.a)%MOD;
        return *this;
    }
    ModInt operator/=(const ModInt p){
        *this*=p.inverse();
        return *this;
    }

    ModInt operator+(const ModInt p){
        ModInt x(a);
        return x+=p;
    }
    ModInt operator-(const ModInt p){
        ModInt x(a);
        return x-=p;
    }
    ModInt operator*(const ModInt p){
        ModInt x(a);
        return x*=p;
    }
    ModInt operator/(const ModInt p){
        ModInt x(a);
        return x*=p.inverse();
    }

    ModInt operator=(ll p){
        p%=MOD;
        if(p<0) p+=MOD;
        a=p;
        return *this;
    }

    bool operator==(const ModInt p){
        return a==p.a;
    }

    bool operator!=(const ModInt p){
        return a!=p.a;
    }

    ModInt pow(ll N) const{
        ModInt ans(1),p(a);
        while(N>0){
            if(bit(N,0)){
                ans*=p;
            }
            p*=p;
            N>>=1;
        }
        return ans;
    }
    ModInt inverse() const{
        return pow(MOD-2);
    }

};

ModInt Mr(ll p){
    p%=MOD;
    if(p<0) p+=MOD;
    ModInt x(p);
    return x;
}

vector<P> prime_factor(ll N){
    vector<P> ret;
    int count=0;
    while(!(N&1)) N>>=1,count++;
    if(count) ret.emplace_back(2,count);

    for(ll i=3;i*i<=N;i++){
        if(N%i==0 ){
            int count=0;
            while(N%i==0){
                N/=i;
                count++;
            }
            ret.emplace_back(i,count);
        }
    }
    if(N!=1) ret.emplace_back(N,1);
    return ret;
}
int C[1100000];

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin>>N;
    vector<ll> A(N);
    for(int i=0;i<N;i++) cin>>A[i];
    for(int i=0;i<N;i++){
        vector<P> V=prime_factor(A[i]);
        for(auto x:V){
            if(C[x.first]<x.second) C[x.first]=x.second;  
        }
    }
    ModInt ans(0),x(1);
    for(int i=2;i<=1000000;i++){
        x*=Mr(i).pow(C[i]);
    }
    //cout<<x.a<<endl;
    for(int i=0;i<N;i++){
        ans+=x/A[i];
        //cout<<ans.a<<endl;
    }
    cout<<ans.a<<endl;
}

Measured memory_bytes: 4096