//E -Flatten //only modular inverse left and change macro too
#include<bits/stdc++.h>
using namespace std;

#ifndef DHRUV_GHEEWALA
    #define p(str) 42
    #define o(str) 108
    #define fundri 137
    #define d(...) 1729
#endif

typedef unsigned int ui;
typedef long long int ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

#define fast ios_base::sync_with_stdio(0)
#define test int t=0;cin>>t;while(t--)

#define nl cout<<'\n'
#define pb push_back
#define pop pop_back
#define all(s) s.begin(),s.end()
#define ff first
#define ss second

#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define loop(i,l,r) for(int i=l;i<=r;i++)
#define rloop(i,r,l) for(int i=r;i>=l;i--)

template<typename TAIL>inline void inp(TAIL& T){cin>>T;}
template<typename T>inline bool in_range(T a,T l,T r){return (a>=l&&a<=r);}
template<typename HEAD,typename... TAIL>inline void inp(HEAD &H,TAIL&... T){cin>>H;inp(T...);}
template<typename T,typename U>inline istream& operator >>(istream& in,pair<T,U> &a){in>>a.ff>>a.ss;return in;}
template<typename T>inline istream& operator >>(istream& in,vector<T> &a){for(auto &x : a)in>>x;return in;}

const ll MOD=(ll)(1E9+7);
template<typename T>inline T mul(T a,T b,ll mod=MOD){return ((a%mod)*(b%mod))%mod;}
template<typename T>inline T sum(T a,T b,ll mod=MOD){return ((a%mod)+(b%mod))%mod;}

#define gcd(a,b) (__gcd(a,b))
//#define lcm(a,b) ((a*b)/gcd(a,b))
#define log(n,b) (log(n)/log(b))
#define setprec(a) cout<<fixed<<setprecision(a)
#define PI (2*acos(0.0))

inline ll pow2(int n){return (1LL<<n);}
inline int digits(ll x){return (floor(log10(x))+1);}
inline bool isPowerOfTwo(ll x){return (x&&(!(x&(x-1))));}
inline ll power(ll a,ll b){if(b==0)return 1;if(b==1)return a;
if(b%2)return power(a,b-1)*a;ll q=power(a,b/2);return q*q;}

inline ll modpower(ll a,ll b,ll mod=MOD){if(b==0)return 1;if(b==1)return a%mod;
if(b%2)return mul(power(a,b-1),a);ll q=power(a,b/2)%mod;return mul(q,q);}
inline ll modinv(ll a,ll mod=MOD){return modpower(a,mod-2,mod);}

ll NcR(int n, int r){long long p=1,k=1;if(n-r<r)r=n-r;if(r)
{while(r){p*=n;k*=r;long long m=__gcd(p, k);p/=m;k/=m;n--;r--;}}else p=1;return p;}


ll pfact(ll num,map<ll, ll> &mp)
{
    ll count=0;
    ll x;
    if(num%2==0)
    {
        x=1;
        num=num>>1;
        count++;
        while(num%2==0)
        {
            num=num>>1;
            count++;
            x++;
        }
        mp[2]=x;
    }

    for(ll i=3;i<=sqrt(num);i+=2)
    {
        if(num%i==0)
        {
            num/=i;
            x=1;
            while(num%i==0)
            {
                x++;
                num/=i;
                count++;
            }
            mp[i]=x;
        }
    }
    if(num>2)
    {
        mp[num]=1;
        count++;
    }
    return count;
}

ll lcm(vector<ll> &a)
{
    int N=a.size();
    vector<map<ll, ll>> x(N);
    d(a);
    rep(i,N)
    {
        pfact(a[i],x[i]);
        d(a[i],x[i]);
    }
    map<ll, ll> l;
    rep(i,N)
    {
        for(auto a : x[i])
        {
            if(l.find(a.ff)!=l.end())
            {
                l[a.ff]=max(l[a.ff],a.ss);
                continue;
            }
            l[a.ff]=a.ss;
        }
    }
    ll ans=1;
    d(l);
    for(auto a : l)
        ans=mul(ans,modpower(a.ff,a.ss));
    return ans;
}
const int MAXN=1e6+1728;
vector<ll> inv(MAXN);

int main()
{
    #ifdef DHRUV_GHEEWALA
        freopen("INPUT.txt","r",stdin);
        freopen("OUTPUT.txt","w",stdout);
        freopen("DEBUG.txt","w",stderr);
    #endif
    
    fast;


    ll n;
    cin>>n;
    vector<ll> a(n);
    cin>>a;

    ll lim=*max_element(all(a));
    inv[1] = 1;
    loop(i,2,lim)
        inv[i]=(MOD-(MOD/i)*inv[MOD%i]%MOD)%MOD;
    ll l=lcm(a);
    d(l);
    ll ans=0;
    rep(i,n)ans=sum(ans,mul(l,inv[a[i]]));
    ans%=MOD;
    cout<<ans,nl;
    return 0;
}

Measured memory_bytes: 11776