#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1000000007;
const double PI = acos(-1);

class Mint
{
private:
    ll x;
public:
    Mint(ll x = 0) :x((x% mod + mod) % mod) {}
    ll Get() const { return x; }
    Mint operator-() const { return Mint(-x); }
    Mint& operator+=(const Mint a)
    {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    Mint& operator-=(const Mint a)
    {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    Mint& operator*=(const Mint a) { (x *= a.x) %= mod; return *this; }
    Mint operator+(const Mint a) const { return Mint(*this) += a; }
    Mint operator-(const Mint a) const { return Mint(*this) -= a; }
    Mint operator*(const Mint a) const { return Mint(*this) *= a; }
    Mint pow(ll t) const
    {
        if (!t) return 1;
        Mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    Mint inv() const { return pow(mod - 2); }
    Mint& operator/=(const Mint a) { return *this *= a.inv(); }
    Mint operator/(const Mint a) const { return Mint(*this) /= a; }
};
ostream& operator<<(ostream& os, const Mint& a) { return os << a.Get(); }

class Sieve
{
private:
    int n;
    vector<int> f, primes;
public:
    Sieve(int n = 1) :n(n), f(n + 1)
    {
        f[0] = f[1] = -1;
        for (ll i = 2; i <= n; ++i) {
            if (f[i]) continue;
            primes.push_back(i);
            f[i] = i;
            for (ll j = i * i; j <= n; j += i) {
                if (!f[j]) f[j] = i;
            }
        }
    }
    bool IsPrime(int x) { return f[x] == x; }
    vector<int> PrimeList(int x)
    {
        vector<int> res;
        while (x != 1) {
            res.push_back(f[x]);
            x /= f[x];
        }
        return res;
    }
    vector<pair<ll, int>> PrimeFrequency(int x)
    {
        vector<int> fl = PrimeList(x);
        if (fl.size() == 0) return {};
        vector<pair<ll, int>> res(1, pair<ll, int>(fl[0], 0));
        for (int p : fl) {
            if (res.back().first == p) {
                res.back().second++;
            }
            else {
                res.emplace_back(p, 1);
            }
        }
        return res;
    }
    vector<pair<ll, int>> PrimeFrequencySelf(ll x)
    {
        vector<pair<ll, int>> res;
        for (int p : primes) {
            int y = 0;
            while (x % p == 0) x /= p, ++y;
            if (y != 0) res.emplace_back(p, y);
        }
        if (x != 1) res.emplace_back(x, 1);
        return res;
    }
};

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];

    Sieve sieve(1e6);
    map<int, int> pf;
    for (int i = 0; i < n; i++) {
        vector<pair<ll, int>> primeFrequency = sieve.PrimeFrequency(a[i]);
        for (const auto& item : primeFrequency) {
            if (pf[item.first] < item.second) pf[item.first] = item.second;
        }
    }
    
    Mint lcm = 1;
    for (const auto& item : pf) {
        for (int i = 0; i < item.second; i++) lcm *= item.first;
    }

    Mint ans;
    for (int i = 0; i < n; i++) ans += lcm / a[i];
    cout << ans << endl;
}


Measured memory_bytes: 4988