#include <bits/stdc++.h>

#define debug(s) cout << s << endl
#define debug1(s, t) cout << s << " " << t << endl
#define debug2(s, t, u) cout << s << " " << t << " " << u << endl
#define printvec(v)       \
    for (auto &&i : v)    \
        cout << i << " "; \
    cout << endl

using namespace std;
using i64 = long long;

const i64 p = 1000000007LL;

template <int MOD>
struct Fp
{
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD)
    {
        if (val < 0)
            val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator-() const noexcept
    {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator+(const Fp &r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator-(const Fp &r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator*(const Fp &r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator/(const Fp &r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp &operator+=(const Fp &r) noexcept
    {
        val += r.val;
        if (val >= MOD)
            val -= MOD;
        return *this;
    }
    constexpr Fp &operator-=(const Fp &r) noexcept
    {
        val -= r.val;
        if (val < 0)
            val += MOD;
        return *this;
    }
    constexpr Fp &operator*=(const Fp &r) noexcept
    {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp &operator/=(const Fp &r) noexcept
    {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b)
        {
            long long t = a / b;
            a -= t * b;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0)
            val += MOD;
        return *this;
    }
    constexpr Fp &operator++() noexcept
    {
        val++;
        if (val >= MOD)
            val -= MOD;
        return *this;
    }
    constexpr Fp operator++(int) noexcept
    {
        Fp temp = *this;
        ++*this;
        return temp;
    }
    constexpr Fp &operator--() noexcept
    {
        val--;
        if (val < 0)
            val += MOD;
        return *this;
    }
    constexpr Fp operator--(int) noexcept
    {
        Fp temp = *this;
        --*this;
        return temp;
    }
    constexpr bool operator==(const Fp &r) const noexcept
    {
        return this->val == r.val;
    }
    constexpr bool operator!=(const Fp &r) const noexcept
    {
        return this->val != r.val;
    }
    friend constexpr ostream &operator<<(ostream &os, const Fp<MOD> &x) noexcept
    {
        return os << x.val;
    }
    friend constexpr Fp<MOD> powmod(const Fp<MOD> &a, long long n) noexcept
    {
        if (n == 0)
            return 1;
        if (n % 2 == 1)
            return a * powmod(a, n - 1);
        Fp<MOD> pwmd = powmod(a, n / 2);
        return pwmd * pwmd;
    }
};

template <int MOD>
constexpr Fp<MOD> powmod(const Fp<MOD> &a, long long n) noexcept
{
    if (n == 0)
        return 1;
    if (n % 2 == 1)
        return a * powmod(a, n - 1);
    Fp<MOD> pwmd = powmod(a, n / 2);
    return pwmd * pwmd;
}

struct Sieve
{
    vector<int> prime_list;

    vector<int> isprime;

    Sieve(int MAX) : prime_list(), isprime(MAX, true)
    {
        isprime[0] = false;
        isprime[1] = false;
        int nsqrt = ceil(sqrt(MAX) + 0.1);
        for (int p = 2; p < nsqrt; p++)
        {
            if (!isprime[p])
                continue;
            prime_list.push_back(p);
            for (int mult = p * p; mult < MAX; mult += p)
                isprime[mult] = false;
        }
        for (int p = nsqrt; p < MAX; p++)
        {
            if (isprime[p])
                prime_list.push_back(p);
        }
    }
};

pair<vector<pair<int, int>>, bool> prime_factorize(int a, vector<int> &prime_list)
{
    vector<pair<int, int>> res;
    bool flag = false;
    for (auto &&prime : prime_list)
    {
        int counter = 0;
        while (a % prime == 0)
        {
            counter++;
            a /= prime;
        }
        res.push_back(make_pair(prime, counter));
    }
    if (a != 1)
    {
        res.push_back(make_pair(a, 1));
        flag = true;
    }
    return make_pair(res, flag);
}

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

int main()
{
    int n;
    cin >> n;

    vector<int> as(n);
    for (auto &&item : as)
        cin >> item;

    // エラトステネスの篩
    int maxbnd = 1000;
    Sieve es(maxbnd);

    // 全体のLCMを素因数分解の表示で計算
    // ここが遅いので要改善
    vector<int> lcm_pf(1000000 + 10);
    for (int i = 0; i < n; i++)
    {
        auto apfrm = prime_factorize(as[i], es.prime_list);
        vector<pair<int, int>> a_pf = apfrm.first;
        if (apfrm.second)
            chmax(lcm_pf[a_pf.back().first], a_pf.back().second);
        for (auto &&pn : a_pf)
        {
            chmax(lcm_pf[pn.first], pn.second);
        }
    }

    // L/Aiを足し合わせる
    Fp<p> L = 1;
    for (int i = 2; i < 1000000; i++)
        L *= pow(i, lcm_pf[i]);
    Fp<p> sum = 0;
    for (auto &&a : as)
        sum += L / a;

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 4224