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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
//#define MOD 1000000007
#define INF LLONG_MAX/2

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
void vin(Vi &v){REP(i,0,(v).size()) cin>>v[i];}
void vin(Vi &v,Vi &v2){REP(i,0,(v).size()) cin>>v[i]>>v2[i];}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());}
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
void accum(Vi &v){REP(i,1,(v).size()) v[i]+=v[i-1];}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

const long long MOD = 1000000007;

map<int,int> prime_factorize(ll n){
   map<int,int> res;
   for (ll p = 2; p*p<=n; ++p){
       if(n%p != 0) continue;
       int num = 0;
       while(n%p == 0){
           ++num; 
           n /= p; 
       }
       res[p]=num;
   }
   if (n != 1) res[n]=1;
   return res;
}
ll fastpow(ll _x,ll _n){
   int ret = 1;
   while(0<_n){
       if((_n%2) == 0){
           _x = (_x*_x)%MOD;
           _n >>= 1;
       }else{
           ret = (ret*_x)%MOD;
           --_n;
       }
   }
   return ret;
}
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
ll moddiv(ll a,ll b){
    return a%MOD * modinv(b, MOD) % MOD;
}

void solve(long long n, std::vector<long long> a){
    if(n==1){cout<<1<<endl;return;}
    map<int,int> lcmv;
    vector<map<int,int>> V(n);
    REP(i,0,n){
        map<int,int> fact=prime_factorize(a[i]);
        V[i]=fact;
        for(auto x : fact){
            if(x.second>lcmv[x.first]){
                lcmv[x.first]=x.second;
            }
        }
    }
    int ans=0;
    int L=1;
    for(auto x : lcmv){
        L = (L*fastpow(x.first,x.second))%MOD;
    }
    REP(i,0,n){
        ans = (ans+ moddiv(L,a[i]))%MOD;
    }
    cout<<ans<<endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
signed main(){
    long long n;
    scanf("%lld",&n);
    std::vector<long long> a(n);
    for(int i = 0 ; i < n ; i++){
        scanf("%lld",&a[i]);
    }
    solve(n, std::move(a));
    return 0;
}


Measured memory_bytes: 3968