// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

const int INF = 1e9;



// ax+by=gcd(a,b) 返り値はgcd(a,b)

ll extgcd(ll a, ll b, ll &x, ll &y) {

    if (b == 0) {

        x = 1;

        y = 0;

        return a;

    }

    ll d = extgcd(b, a % b, y, x);

    y -= (a / b) * x;

    return d;

}



ll modinv(ll a, ll m) {

    ll x, y;

    extgcd(a, m, x, y);

    ll u = x % m;

    if (u < 0) return u += m;

    return u;

}





ll prime[1000010];

const ll mod = 1000000007;



int main(){

    ll n;

    cin >> n;

    vector<ll> a(n);

    for (int i = 0; i < n; ++i) {

        cin >> a[i];

        ll p = a[i];

        for (int j = 2; j * j <= a[i]; ++j) {

            ll cnt = 0;

            while(p % j == 0){

                cnt++;

                p /= j;

            }

            prime[j] = max(prime[j], cnt);

        }

        if(p != 1) prime[p] = max(prime[p], 1LL);

    }



    ll lcm = 1;

    for (ll i = 1; i <= 1000000; ++i) {

        for (int j = 0; j < prime[i]; ++j) {

            lcm *= i;

            lcm %= mod;

        }

    }



    ll res = 0;

    for (int i = 0; i < n; ++i) {

        res += lcm * modinv(a[i], mod);

        res %= mod;

    }

    cout << res << endl;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef pair<int, int> pii;

typedef pair<ll, ll> pll;

#define all(x) x.begin(), x.end()

#define rall(x) x.rbegin(), x.rend()

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int INF = (1<<30) - 1;

const ll LINF = (1LL<<60) - 1;



template <int mod>

struct ModInt {

    ll x;

    ModInt() : x(0) {}

    ModInt(ll y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

    ModInt &operator+=(const ModInt &p) { if((x += p.x) >= mod) x -= mod; return *this; }

    ModInt &operator-=(const ModInt &p) { if((x += mod - p.x) >= mod) x -= mod; return *this; }

    ModInt &operator*=(const ModInt &p) { x = 1LL * x * p.x % mod; return *this; }

    ModInt &operator/=(const ModInt &p) { *this *= p.inverse(); return *this; }

    ModInt operator-() const { return ModInt(-x); }

    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }

    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }

    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }

    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }

    bool operator==(const ModInt &p) const { return x == p.x; }

    bool operator!=(const ModInt &p) const { return x != p.x; }

    ModInt inverse() const {

        ll a = x, b = mod, u = 1, v = 0, t;

        while(b > 0) {

            t = a / b;

            swap(a -= t * b, b);

            swap(u -= t * v, v);

        }

        return ModInt(u);

    }

    ModInt pow(ll n) const {

        ModInt ret(1), mul(x);

        while(n > 0) {

            if(n & 1) ret *= mul;

            mul *= mul;

            n >>= 1;

        }

        return ret;

    }

    friend ostream &operator<<(ostream &os, const ModInt &p) {

        return os << p.x;

    }

    friend istream &operator>>(istream &is, ModInt &a) {

        int64_t t;

        is >> t;

        a = ModInt<mod>(t);

        return (is);

    }

};

const int mod = 1000000007;

using mint = ModInt<mod>;



map<ll, ll> prime_factor(ll n){

    map<ll, ll> res;

    for (ll i = 2; i * i <= n; ++i) {

        while(n % i == 0){

            res[i]++;

            n /= i;

        }

    }

    if(n != 1) res[n] = 1;

    return res;

}



int main(){

    int n;

    cin >> n;

    vector<ll> a(n);

    map<ll, ll> lcm;

    for (int i = 0; i < n; ++i) {

        cin >> a[i];



        auto X = prime_factor(a[i]);

        for (auto &x : X){

            chmax(lcm[x.first], x.second);

        }

    }



    mint l = 1;

    for (auto &x : lcm){

        l *= mint(x.first).pow(x.second);

    }

    mint res = 0;

    for (int i = 0; i < n; ++i) {

        res += mint(a[i]).inverse();

    }

    res *= l;

    cout << res << endl;

}

// Fastest known solution for this problem: