#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//typedef
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//conversion
inline LL toLong(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define PUTS(x) cout << (x) << endl;

const LL MOD = 1e9 + 7;

class ModCombination{
    vector<LL> fact_, inv_, finv_;
public:
    ModCombination() {}
    ModCombination(LL n) noexcept : fact_(n, 1), inv_(n, 1), finv_(n, 1) {
        init(n);
    }
    void init(LL n) noexcept {
        fact_.assign(n, 1), inv_.assign(n, 1), finv_.assign(n, 1);
        for(LL i = 2; i < n; i++){
            fact_[i] = fact_[i-1] * i % MOD;
            inv_[i] = MOD - inv_[MOD%i] * (MOD/i) % MOD;
            finv_[i] = finv_[i-1] * inv_[i] % MOD;
        }
    }
    LL comb(LL n, LL k) const noexcept {
        if (n < k || n < 0 || k < 0) return 0;
        return fact_[n] * (finv_[k] * finv_[n-k] %MOD) % MOD;
    }
    LL fact(LL n) const noexcept {
        if (n < 0) return 0;
        return fact_[n];
    }
    LL inv(LL n) const noexcept {
        if (n < 0) return 0;
        return inv_[n];
    }
    LL finv(LL n) const noexcept {
        if (n < 0) return 0;
        return finv_[n];
    }
};
ModCombination mod_comb(1000001);

LL pow_fast(LL a,LL n){
    LL p = a;
    LL ret = 1;
    while(n){
        if(n & 1) ret = ret * p;
        n = n >> 1;
        p = p * p;
    }
    return ret;
}

LL p[1000001]={0};

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    LL n;
    cin>>n;
    VL a(n);
    REP(i,n)cin>>a[i];

    LL a_lcm = 1;
    REP(i,n){
        LL k = a[i];
        LL x = 2;
        while(k >= x * x){
            if(k % x == 0){
                LL cnt = 0;
                while(k % x == 0){
                    cnt++;
                    k/=x;
                }
                p[x] = max(p[x], cnt);
            }
            else{
                x++;
            }
        }
        p[k] = max(p[k], (LL)1);
    }
    REP(i,1000001){
        a_lcm *= pow_fast(i, p[i]);
        a_lcm %=MOD;
    }

    LL ans = 0;
    REP(i,n){
        ans += a_lcm * mod_comb.inv(a[i]);
        ans %= MOD;
    }
    PUTS(ans);
}

Measured memory_bytes: 30080