#include<bits/stdc++.h>
using namespace std;
/**
********************************************************************
******************* Author:Bisnu sarkar ****************************
********************************************************************
**/
#define ull            unsigned long long
#define ll             long long
#define vi             vector<int>
#define pb             push_back
#define mp             make_pair
#define pii            pair<int,int>
#define vit            vector<int> :: iterator
#define sit            set<int> :: iterator
#define vrit           vector<int> :: reverse iterator
#define ff             first
#define ss             second
#define endl           '\n';
#define what_is(x)     cerr << #x << " is " << x << endl;
///*....Debugger....*/
#define error(args...) {vector <string> _v = split(#args, ','); err(_v.begin(), args); cout << endl;}
vector <string> split(const string &s, char c) {
    vector <string> v;
    stringstream ss(s); string x;
    while (getline(ss, x, c)) v.emplace_back(x);
    return move(v);
}
void err(vector <string> :: iterator it) {}
template <typename T, typename... Args>
void err(vector <string> :: iterator it, T a, Args... args) {
    cout << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << ", ";
    err(++it, args...);
}
 
int ini(){int x; scanf("%d",&x);return x;}
long long inl(){ long long x;scanf("%lld",&x); return x;}
double ind(){double x; scanf("%lf",&x);return x;}
#define Iin ini();
#define Lin inl();
#define Din ind();

int set_1(int n,int pos){return n = (n | (1<<pos));}
int reset_0(int n,int pos){return n= n & ~(1<<pos);}
bool check_bit(int n,int pos){return n = n & (1<<pos);}

int dx[8]= {1,0,-1,0,-1,-1,1,1};
int dy[8]= {0,1,0,-1,-1,1,-1,1};
const int N = (int) 1e6 + 5;
const int M = (int) 1e9 + 7;
const double pi=2* acos(0.0);
const double eps=1e-9;

ll a[N];

long long bigmod(long long b,long long p,long long m){
    if(p==0)return 1%m;
    long long x=bigmod(b,p/2,m);
    x=(x*x)%m;
    if(p%2==1)x=(x*b)%m;
    return x;
}

int prime[N],p;
bool mark[N];

void seive(int n) {
    int i,j,limit=sqrt(n+1);

    mark[1]=true;
    prime[p++]=2;
    for(i=4; i<=n; i+=2)
        mark[i]=true;

    for(i=3; i<=n; i+=2) {
        if(!mark[i]) {
            prime[p++]=i;
            if(i<=limit) {
                for(j=i*i; j<=n; j+=i*2) {
                    mark[j]=true;
                }
            }
        }
    }
   

}
map<ll,ll>m;
void fac(ll x){
    for(int i=0;i<p and prime[i]*prime[i] <=x;++i){
        if(x%prime[i]==0){
            ll c=0ll;

            while(x%prime[i]==0){
                x/=prime[i];
                ++c;
            }
            m[prime[i]]=max(m[prime[i]],c);

        }
    }
    if(x>1){
        m[x]=max(m[x],1ll);
    }

}


int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);  
    int t=1,te=0;

    seive(N);
   // printf("%d\n", p);
   // cin>>t;
    while(t--){
        int n;
        cin>>n;
    
        for(int i=1;i<=n;++i)
        {
            cin>>a[i];
            fac(a[i]);
        }
        std::vector<pii> v;

        ll x=1ll;
        for(map<ll,ll>::iterator it=m.begin();it!=m.end();++it){
            v.push_back({it->first,it->second});

            x=(x*bigmod(it->first,it->second,M))%M;
           // printf("%lld %lld\n", it->first,it->ss);
        }

        ll res=0ll;

        for(int i=1;i<=n;++i){
            
            ll xx;
            xx=x*bigmod(a[i],M-2,M);
        
           // printf("%lld\n", x);
            res = (res+xx)%M;
        }

        printf("%lld\n", res);



        //printf("Case %d: ",++te);
    }
    return 0;
}




Measured memory_bytes: 4480