#include <bits/stdc++.h>
using namespace std;
using ll = long long;

const ll MOD = 1e9 + 7;

template<ll MOD> struct ModInt {
    ll value;
    ModInt() : value(0) {}
    ModInt(const ll& v) : value(v % MOD) {
        if ( value < 0 ) value += MOD;
    }
    ModInt<MOD>& operator=(const ModInt& o) {
        value = o.value;
        return *this;
    }
    ModInt<MOD>& operator+=(const ModInt& o) {
        value += o.value;
        if ( value >= MOD ) value -= MOD;
        return *this;
    }
    ModInt<MOD>& operator-=(const ModInt& o) {
        value += MOD - o.value;
        if (value >= MOD ) value -= MOD;
        return *this;
    }
    ModInt<MOD>& operator*=(const ModInt& o) {
        value *= o.value;
        value %= MOD;
        return *this;
    }
    ModInt<MOD>& operator/=(const ModInt& o) {
        value *= inverse(o.value);
        value %= MOD;
        return *this;
    }
    ModInt<MOD> operator-() {
        return ModInt<MOD>(-value);
    }
    ModInt<MOD> operator+(const ModInt& o) {
        ModInt<MOD> r(*this);
        r += o;
        return r;
    }
    ModInt<MOD> operator-(const ModInt& o) {
        ModInt<MOD> r(*this);
        r -= o;
        return r;
    }
    ModInt<MOD> operator*(const ModInt& o) {
        ModInt<MOD> r(*this);
        r *= o;
        return r;
    }
    ModInt<MOD> operator/(const ModInt& o) {
        ModInt<MOD> r(*this);
        r /= o;
        return r;
    }
    ModInt<MOD> pow(ll n) {
        ModInt<MOD> t = *this, r = 1;
        while ( n > 0 ) {
            if ( n & 1 ) r *= t;
            t *= t;
            n >>= 1;
        }
        return r;
    }
private:
    ll inverse(ll a) {
        ModInt<MOD> t(a);
        ll k = MOD - 2LL;
        return t.pow(k).value;
    }
};
template<ll MOD> std::ostream& operator<< (std::ostream& os, const ModInt<MOD>& o) {
    os << o.value;
    return os;
}
template<ll MOD> std::istream& operator>> (std::istream& is, ModInt<MOD>& o) {
    is >> o.value;
    return is;
}

using Int = ModInt<MOD>;

Int solve() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    for ( int i = 0; i < N; i++ ) {
        cin >> A[i];
    }

    auto PrimeFactorTable = [](ll n) {
        vector<ll> pr(n+1);
        vector<ll> mind(n+1);
        mind[0] = mind[1] = 1;
        for ( ll k = 2; k <= n; k++ ) {
            if ( mind[k] == 0 ) {
                pr.push_back(k);
                mind[k] = k;
            }
            for ( ll j = 1; j*k <= n; j++ ) {
                if ( mind[j*k] == 0 ) mind[j*k] = k;
            }
            // for ( ll j = 0; j < pr.size() && pr[j]<=mind[k] && k*pr[j]<=n; j++ ) {
            //     mind[k*pr[j]] = pr[j];
            // }
        }
        return mind;
    };
    vector<ll> mind = PrimeFactorTable(1e6);
    map<ll,ll> f;
    for ( int i = 0; i < N; i++ ) {
        map<ll,ll> t;
        ll a = A[i];
        while ( a > 1 ) {
            t[mind[a]]++;
            a /= mind[a];
        }
        for ( auto tt : t ) {
            f[tt.first] = max(f[tt.first], tt.second);
        }
    }

    Int m(1);
    for ( auto ff : f ) {
        Int a(ff.first);
        m *= a.pow(ff.second);
    }
    Int ib(0);
    for ( int i = 0; i < N; i++ ) {
        Int a(A[i]), ii(1);
        Int x = ii / a;
        ib += x;
    }
    Int ans = ib;
    ans *= m;
    return ans;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 25728