#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for (int i = a; i < (int)b; ++i)
#define rrep(i, n) for (int i = ((int)n - 1); i >= 0; --i)

using ll = long long;
using ld = long double;

const int Inf = 1e9;
const double EPS = 1e-9;
const ll MOD = 1e9 + 7;

const int N = 1e6 + 5;

class LinearSieve {
    public:
        vector<int> lp, pr;
        LinearSieve() {}
        LinearSieve(int n) {
            lp.resize(n + 1);
            init(n);
        }

        void init(int x) {
            FOR (i, 2, x + 1) {
                if (lp[i] == 0) {
                    lp[i] = i;
                    pr.push_back(i);
                }
                for (int j = 0; j < (int)pr.size() && pr[j] <= lp[i] && (ll)i * pr[j] <= x; ++j) {
                    lp[i * pr[j]] = pr[j];
                }
            }
        }

        bool isPrime(int x) { return lp[x] == x; }

        vector<int> factorlist(int x) {
            vector<int> res;
            while (x != 1) {
                res.push_back(lp[x]);
                x /= lp[x];
            }

            return res;
        }

        vector<pair<int, int> > factorize(int x) {
            vector<int> p = factorlist(x);
            if (p.size() == 0) return {};
            vector<pair<int, int> > res(1, make_pair(p[0], 0));
            rep (i, p.size()) {
                if (res.back().first == p[i]) {
                    res.back().second++;
                } else {
                    res.emplace_back(p[i], 1);
                }
            }

            return res;
        }
};

template<typename T>
T modpower(T a, T n, T mod) {
    T res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

template<typename T>
T modinv(T a, T mod) {
    return modpower(a, mod - 2, mod);
}

// vector<pair<int, int> > linear_sieve(ll x) {
//     vector<int> lp(x + 1), pr;
//     vector<int> f;
//     FOR (i, 2, x + 1) {
//         if (lp[i] == 0) {
//             lp[i] = i;
//             pr.push_back(i);
//         }
//         for (int j = 0; j < (int)pr.size() && pr[j] <= lp[i] && (ll)i * pr[j] <= x; ++j) {
//             lp[i * pr[j]] = pr[j];
//         }
//     }
//     while (x != 1) {
//         f.push_back(lp[x]);
//         x /= lp[x];
//     }
    
//     if (f.size() == 0) {
//         return {};
//     }
//     vector<pair<int, int> > res(1, make_pair(f[0], 0));
//     rep (i, f.size()) {
//         if (res.back().first == f[i]) {
//             res.back().second++;
//         } else {
//             res.emplace_back(f[i], 1);
//         }
//     }

//     return res;
// }

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
    LinearSieve ls = LinearSieve(N);
    int n;
    cin >> n;
    ll res = 0;
    map<int, int> mp;
    vector<ll> a(n);
    
    rep (i, n) {
        cin >> a[i];
        auto v = ls.factorize(a[i]);
        rep (j, v.size()) {
            mp[v[j].first] = max(mp[v[j].first], v[j].second);
        }
    }
    ll l = 1;
    for (auto p : mp) {
        rep (i, p.second) {
            l *= p.first;
            l %= MOD;
        }
    }
    rep (i, n) {
        ll tmp = l * modinv(a[i], MOD);
        res += tmp;
        res %= MOD;
    }
    cout << res << endl;
    
    return 0;
}



Measured memory_bytes: 4984