#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
template <class T> void corner(bool flg, T hoge) {
    if(flg) {
        cout << hoge << endl;
        exit(0);
    }
}
#define all(v) v.begin(), v.end()
#define inputv(v, n)                                                           \
    vl v;                                                                      \
    rep(i, n) {                                                                \
        ll x;                                                                  \
        cin >> x;                                                              \
        v.push_back(x);                                                        \
    }
const ll INF = 999999999999999;
const ll MOD = 1000000007;
ll a, b, c, d, e, f, p, t, x, y, z, q, m, n, r, h, k, w, l, ans;
#include <cstdint>

template <std::uint_fast64_t Modulus> class modint {
    using u64 = std::uint_fast64_t;

  public:
    u64 a;

    constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
    constexpr u64 &value() noexcept { return a; }
    constexpr const u64 &value() const noexcept { return a; }
    constexpr modint operator+(const modint rhs) const noexcept {
        return modint(*this) += rhs;
    }
    constexpr modint operator-(const modint rhs) const noexcept {
        return modint(*this) -= rhs;
    }
    constexpr modint operator*(const modint rhs) const noexcept {
        return modint(*this) *= rhs;
    }
    constexpr modint operator/(const modint rhs) const noexcept {
        return modint(*this) /= rhs;
    }
    constexpr modint &operator+=(const modint rhs) noexcept {
        a += rhs.a;
        if(a >= Modulus) {
            a -= Modulus;
        }
        return *this;
    }
    constexpr modint &operator-=(const modint rhs) noexcept {
        if(a < rhs.a) {
            a += Modulus;
        }
        a -= rhs.a;
        return *this;
    }
    constexpr modint &operator*=(const modint rhs) noexcept {
        a = a * rhs.a % Modulus;
        return *this;
    }
    constexpr modint &operator/=(modint rhs) noexcept {
        u64 exp = Modulus - 2;
        while(exp) {
            if(exp % 2) {
                *this *= rhs;
            }
            rhs *= rhs;
            exp /= 2;
        }
        return *this;
    }
};
vl A(1000100, 0), B(300000);
vl C(1000100, 0);
void insuu(ll x) {
    while(x > 1) {
        t=0;
        k = A[x];
        while(x % k == 0) {
            x /= k;
            t++;
        }
        C[k]=max(C[k],t);
    }
}
using mint = modint<MOD>;
int main() {
    cin >> n;
    mint ANS=0,lcm=1;
    a = 1000010;
    for(ll i = 2; i < a + 1; i++) {
        if(A[i] == 0) {
            A[i] = i;
            for(ll j = 1; j * i <= a; j++) {
                A[j * i] = i;
            }
        }
    }
    inputv(Q,n);

    k=Q[0];
    rep(i,n-1){
        k=__gcd(k,Q[i+1]);
    }

    rep(i,n){
        Q[i]/=k;
    }

    rep(i,n){
        insuu(Q[i]);
    }

    rep(i,1000010){
        rep(j,C[i]){
            lcm*=i;
        }
    }

    rep(i,n){
        ANS+=lcm/Q[i];
    }

    

    cout << ANS.a << endl;
}

Measured memory_bytes: 18432