#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <chrono>
#include <utility>
#include <string>
#include <cmath>
#define rep(i, n, m) for(int i = (n); (i) < (m); (i)++)
#define len(arr) sizeof(arr) / sizeof(*arr)
using namespace std;


// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};
using mint = Fp<1000000007>;


const unsigned long long mod = pow(10, 9) + 7;

const int NN = pow(10, 6) + 100;
vector<unsigned long long> primes;
bool isprime[NN + 1];
long long min_factor[NN + 1];

void setup(){
    //エラトステネスの篩
    rep(i, 0, NN + 1){
        isprime[i] = true;
        min_factor[i] = -1;
    }
    rep(i, 2, NN + 1){
        if(!isprime[i]) continue;
        primes.push_back(i);
        min_factor[i] = i;
        for(int j = i * 2; j <= NN; j += i){
            isprime[j] = false;
            if(min_factor[j] == -1) min_factor[j] = i;
        }
    }
}

vector<pair<unsigned long long, unsigned long long>> prime_factrize(unsigned long long n){
    vector<pair<unsigned long long, unsigned long long>> res;
    while(n != 1){
        unsigned long long prime = min_factor[n];
        unsigned long long exp = 0;
        while(min_factor[n] == prime){
            exp++;
            n /= prime;
        }
        res.push_back(make_pair(prime, exp));
    }
    return res;
}


unsigned long long modpow(unsigned long long a, unsigned long long n){
    unsigned long long res = 1;
    while(n > 0){
		if(n & 1) res = res * a % mod;
		a = a*a %mod;
		n >>= 1;
	}
    return res;
}

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

    unsigned long long n;
    cin >> n;
    unsigned long long a[int(pow(10, 4) + 100)];
    rep(i, 0, n) cin >> a[i];

    vector<pair<unsigned long long, unsigned long long>> ll;

    rep(i, 0, n){
        vector<pair<unsigned long long, unsigned long long>> aa = prime_factrize(a[i]);
        rep(j, 0, aa.size()){
            bool flag = true;
            rep(k, 0, ll.size()){
                if(aa[j].first == ll[k].first){
                    ll[k].second = max(ll[k].second, aa[j].second);
                    flag = false;
                    break;
                }
            }
            if(flag) ll.push_back(aa[j]);
        }
    }
    //rep(i, 0, ll.size()) cout << ll[i].first << ' ' << ll[i].second << endl;
    mint l = 1;
    rep(i, 0, ll.size()) l *= modpow(ll[i].first, ll[i].second);
    mint ans = 0;
    rep(i, 0, n) ans += l / a[i];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 10232