#include <bits/stdc++.h>

using namespace std;
using ll = int64_t;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using mii = map<int, int>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using tpi = tuple<int, int, int>;

using vqi = vector<queue<int>>;
using vpi = vector<pii>;
using bs = bitset<60>;
using vbi = vector<bs>;

ll gcd(ll a, ll b) {
    if (a < b) {
        swap(a, b);
    }

    /* ユークリッドの互除法 */
    ll r = a % b;
    while (r != 0) {
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

constexpr int64_t __pow_mod(int64_t n, int64_t p, int64_t mod) noexcept {
    if (p == 0) {
        return 1;
    }
    if (p % 2 == 0) {
        int64_t t = __pow_mod(n, p / 2, mod);
        return (t * t) % mod;
    }
    return (n * (__pow_mod(n, p - 1, mod) % mod)) % mod;
}

constexpr int64_t pow_mod(int64_t n, int64_t p, int64_t mod) noexcept {
    int64_t res = __pow_mod(n, p, mod);
    if (res == 0) {
        res = mod;
    }
    return res;
}

constexpr int64_t nCr_mod(int64_t n, int64_t r, int64_t mod) noexcept {
    int64_t count = 1;
    auto a = r;
    for (auto i = n; i > n - r; i--) {
        count *= i;
        if (count % mod != 0) {
            count %= mod;
        }
        int64_t inv = pow_mod(a, mod - 2, mod);
        count *= inv;
        if (count % mod != 0) {
            count %= mod;
        }
        a--;
    }
    return count;
}

vi eratosthenes(int max) {
    vi ans(max + 1);
    for (int i = 0; i < ans.size(); i++) {
        ans[i] = i;
    }

    double max_rt = sqrt(max);
    int p = 2;
    while (p <= max_rt) {
        for (int i = 2 * p; i <= max; i += p) {
            ans[i] = min(ans[i], p);
        }
        p++;
        while (ans[p] != p) {
            p++;
            if (p > max_rt) {
                break;
            }
        }
    }
    return move(ans);
}

constexpr long long MOD = 1000000007;

void solve(long long N, std::vector<long long> A) {
    constexpr ll MAX = 1e6;
    auto prime_t = eratosthenes(MAX);

    vi V(MAX + 1);
    V[1] = 1;
    for (int i = 0; i < N; i++) {
        int a = A[i];
        while (a != 1) {
            int p = prime_t[a];
            int count = 0;
            while (a % p == 0) {
                a /= p;
                count++;
            }
            V[p] = max(V[p], count);
        }
    }
    ll x = 1;
    for (int i = 2; i <= MAX; i++) {
        if (V[i] != 0) {
            for (int j = 0; j < V[i]; j++) {
                x *= i;
                x %= MOD;
            }
        }
    }
    ll ans = 0;
    for (int i = 0; i < N; i++) {
        ll inv_a = pow_mod(A[i], MOD - 2, MOD);
        inv_a %= MOD;
        ans += x * inv_a;
        ans %= MOD;
    }
    cout << ans << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
    long long N;
    std::cin >> N;
    std::vector<long long> A(N);
    for (int i = 0; i < N; i++) {
        std::cin >> A[i];
    }
    solve(N, std::move(A));
    return 0;
}

Measured memory_bytes: 8192