//#pragma GCC optimize(3)

#include<bits/stdc++.h>
#define MST(a,b) memset(a,b,sizeof(a))
#define pb push_back
#define eb emplace_back
#define rep(i,a,b) for(int i = a ; i < b ; ++i)
#define per(i,a,b) for(int i = a ; i > b ; --i)
#define ALL(v) v.begin(),v.end()
#define ft first
#define sd second
using namespace std;
namespace fast_IO{
    const int maxbuff = 1<<17;
    char ibuff[maxbuff],obuff[maxbuff];
    inline char Getchar(){
        static char *p1=ibuff,*p2=ibuff;
        if(p1 == p2) {
            p1 = ibuff;
            p2 = ibuff+fread(ibuff,1,maxbuff,stdin);
            if(p1 == p2) return -1;
        }
        return *p1++;
    }

    int optr = 0;
    inline void Putchar(char c) {
        if(optr == maxbuff) {fwrite(obuff,1,optr,stdout);optr = 0;}
        obuff[optr++] = c;
    }

    inline void Flush() {
        fwrite(obuff,1,optr,stdout);
    }

    template<class T>
    inline int read(T &x) {
        x = 0;
        char c = Getchar();
        if(c == EOF) return -1;
        for( ; (c < '0' || c > '9') && c != EOF ; c = Getchar());
        if(c == EOF) return -1;
        for( ; c >= '0' && c <= '9' ; c = Getchar()) x = x*10+c-'0';
        return 0;
    }

    template<class T>
    inline void write(const T &x,int tag = 0) {
        if(!x) {
            if(!tag) Putchar(x+'0');
            return ;
        }
        write(x/10,1);
        Putchar(x%10+'0');
    }

    template<class T>
    inline void writeln(const T &x) {
        write(x);Putchar('\n');
    }

    template<class T>
    inline void writesp(const T &x) {
        write(x);Putchar(' ');
    }
}
template<class T> void show(T *x,int len,int s = 0) {for(int i = s ; i < s+len-1 ; ++i) cerr << x[i] << ' ';cerr << x[s+len-1] << endl;}
void debug() {cerr << endl;}
template <typename T, typename... Args> void debug(T x,Args... args) {cerr << x << ' ';debug(args...);}
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> pii;
#include <ext/pb_ds/priority_queue.hpp>
using namespace __gnu_pbds;
typedef __gnu_pbds::priority_queue<pii,greater<>,pairing_heap_tag> heap;
typedef heap::point_iterator iter;

template<class T>
inline void cmin(T &A,const T &B) {A = (A<B?A:B);}
template<class T>
inline void cmax(T &A,const T &B) {A = (A>B?A:B);}

const int N = 1e6+19;
const LL P = 1e9+7;
LL inv[N],p[N],A[N],n,vis[N];
int pre[N];

void init() {
    inv[1] = 1;
    for(int i = 2 ; i < N ; ++i) {
        inv[i] = (P-P/i)*inv[P%i]%P;
        if(!vis[i]) {
            pre[i] = i;
            for(int j = 2*i ; j < N ; j += i) {
                if (pre[j]) pre[j] = min(pre[j], i);
                else pre[j] = i;
                vis[j] = 1;
            }
        }
    }
}

void work(int x) {
    LL tot = 0,pos = pre[x];
    while(x != 1) {
        if(pre[x] != pos) {
            p[pos] = max(p[pos],tot);
            tot = 1;
            pos = pre[x];
        }
        else ++tot;
        x /= pre[x];
    }
    p[pos] = max(p[pos],tot);
}

void solve() {
    cin >> n;
    init();
    for(int i = 1 ; i <= n ; ++i) cin >> A[i];
    for(int i = 1 ; i <= n ; ++i)
        work(A[i]);
    LL val = 1,sum = 0;
    for(int i = 1 ; i < N ; ++i)
        for(int j = 1 ; j <= p[i] ; ++j)
            val = val*i%P;
    for(int i = 1 ; i <= n ; ++i)
        sum = (sum+val*inv[A[i]]%P)%P;
    cout << sum << endl;
}

signed main() {
#ifdef LOCAL
    //freopen("input","r",stdin);
    //freopen("output","w",stdout);
#endif
    srand((int)time(0));
    ios::sync_with_stdio(0);
    int T = 1;
    //cin >> T;
    while(T--) solve();
}

Measured memory_bytes: 29312