#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1E6+7;
const ll mod=1e9+7;
ll arr[N];
ll mp[N];
ll ksm(ll a,ll b){
    ll res=1;
    while(b){
        if(b&1) res=res*a%mod;
        a=a*a%mod;
        b>>=1;
    }
    return res%mod;
}
int main()
{
    ios::sync_with_stdio(false );
    ll n;
    cin>>n;
    ll mx=0;
    for(ll i=1;i<=n;i++){
        cin>>arr[i];
        mx=max(mx,arr[i]);
    }
    ll pos=0;
    for(ll i=1;i<=n;i++){
        ll x=arr[i];
        ll y=sqrt(x);
        for(ll j=2;j<=y;j++){
            ll cnt=0;
            while(x%j==0){
                x/=j;
                cnt++;
            }
            mp[j]=max(mp[j],cnt);
        }
        if(x!=1) mp[x]=max(mp[x],(ll)1);
    }
    ll sum=1;
    for(ll i=1;i<=mx;i++)
        sum=(sum%mod*ksm(i,mp[i])%mod)%mod;
    ll ans=0;
    for(ll i=1;i<=n;i++){
        ans+=sum*ksm(arr[i],mod-2)%mod;
    }
    cout<<ans%mod<<endl;
    return 0;
}