#include <bits/stdc++.h>

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define _dec(i,N,j) for(int i = (N-1);i >= (j);i--)
#define _rec(i,N,j) for(int i = (N);i >=(j);i--)
#define ALL(x) x.begin(),x.end()
#define MEM(a,n) memset(a,n,sizeof(a))
#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define PTR2(a,j,N,k,L) for(int i = (j); i <= (N);i++) see(a[i],k,L);


#define REP(i,n) for(long long i=0;i<n;i++)
#define REP1(i,n) for(long long i=1;i<=n;i++)
#define REPB(i,n) for(long long i=((n)-1);i>=0;i--)
#define REPB1(i,n) for(long long i=(n);i>0;i--)
#define ITE(arr) for(auto ite=(arr).begin();ite!=(arr).end();ite++)
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define YNPRT(b) cout<<((b)?"Yes":"No")<<endl
#define REV(arr) reverse(ALL(arr))

typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

int get_int(){int x;scanf("%d",&x);return x;}
LL get_ll(){LL x;scanf("%lld",&x);return x;}
double get_db(){double x;scanf("%lf",&x);return x;}

template<typename T> int chmin(T &a,T b){if(a > b){a = b;return 1;}else return 0;}
template<typename T> int chmax(T &a,T b){if(a < b){a = b;return 1;}else return 0;}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {_for(i,0,v.size()) os << v[i] << " ";return os;}
template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){for(auto a:v) os << a <<" ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& v){os << v.fst <<" "<<v.scd << " ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const map<T1,T2>& v){for(auto a:v) cout << a << endl;return os;}
template<typename T> void see(T a[],int from,int to){ _rep(i,from,to) cout << a[i]<<" ";cout << endl;}

static const int dx[8] = { -1,  0, 1, 0,  1, -1,  1, -1};
static const int dy[8] = {0,  1, 0,  -1,  1, -1, -1,  1};
const double pi  = acos(-1.0);
const double eps = 1e-8;
const LL  INF  = 0x3f3f3f3f3f3f3f3f;
const int inf  = 0x3f3f3f3f;
const int maxn = 1e6+5;
const int MOD = 1e9+7;
int N,K;

LL inv[maxn];
LL fac[maxn];
LL facinv[maxn];
LL modpow(LL a, LL b){
    if(b==-1) return inv[a];
    if(b<-1) {
    a=inv[a%MOD];
    b*=-1;
    }
    if(b==0) return 1;
    if(b==1) return a%MOD;
    LL ret=modpow(a%MOD,b>>1)%MOD;
    return (ret*ret%MOD)*((b%2)?(a%MOD):1)%MOD;
}
LL fermat(LL a){
    if(a%MOD) return -1;
    return modpow(a,MOD-2);
}
inline LL modmult(LL a, LL b){
    return (a%MOD)*(b%MOD)%MOD;
}
inline LL modmult(LL a, LL b ,LL c){
    return (a%MOD)*(b%MOD)%MOD*(c%MOD)%MOD;
}
inline LL modfact(LL n){
    if(n==0 || n==1) return 1;
    if(n>=MOD) return 0;
    return fac[n];
}
inline LL modcomb(LL m, LL n){
    if(m>=MOD || n>=MOD || n<0 || m<0) return -1;
    if(n==0||n==m) return 1;
    if(m<n) return 0;
    return fac[m]*facinv[m-n]%MOD*facinv[n]%MOD;
}
void makelist(){
    inv[0]=-1;
    inv[1]=1;
    for(LL i=2;i<maxn;i++) inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
    fac[0]=1;
    REP1(i,maxn) fac[i]=(fac[i-1]*i)%MOD;
    facinv[maxn-1] = modpow(fac[maxn-1],MOD-2);
    REPB(i,maxn-1) facinv[i]=(facinv[i+1]*(i+1))%MOD;
}

int A[maxn];
int prime_c[maxn];

void deco(int num){
    int limi = sqrt(num+1);
    _rep(i,2,limi){
        if(num % i == 0){
            int cnt = 0;
            while(num%i == 0){
                cnt++;
                num /= i;
            }
            prime_c[i] = max(prime_c[i] , cnt);
        }
    }
    if(num != 1) prime_c[num] = max(prime_c[num],1);
}

int main()
{
    makelist();
    MEM(prime_c,0);

    int N;
    cin >> N;
    _for(i,0,N){
        cin >> A[i];
        deco(A[i]);
    }

    //printf("OK\n");

    LL g = 1;
    _for(i,2,maxn){
        if(prime_c[i])
            g = (g * modpow(i,prime_c[i]))%MOD;
    }

    LL ans = 0;
    _for(i,0,N){
        ans = (ans + (g * inv[A[i]])%MOD )%MOD;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 29440