#pragma region Header
#ifdef DEBUG
#include "debug.hpp"
#else
#define NDEBUG
#define debug(...)
#define IFD(...)
#endif
#include <utility>
#include <cstdint>
#include <cmath>
#include <vector>
#include <array>
#include <deque>
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <string>
#include <functional>
#include <algorithm>
#include <numeric>
#include <stdexcept>
#include <iostream>
#include <iomanip>
using namespace std;
using i32 = int32_t;
using i64 = int64_t;
using u32 = uint32_t;
using u64 = uint64_t;
#define rep(i, n) for (int i = 0; i < static_cast<int>(n); ++i)
#define repd(i, n) for (int i = static_cast<int>(n) - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = static_cast<int>(a); i <= static_cast<int>(b); ++i)
#define FORD(i, b, a) for (int i = static_cast<int>(b); i >= static_cast<int>(a); --i)
template <typename T>
int SZ(T const &x)
{
    return static_cast<int>(x.size());
}
template <class T>
bool chmax(T &a, T const &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
bool chmin(T &a, T const &b)
{
    if (b < a)
    {
        a = b;
        return true;
    }
    return false;
}
template <u32 p>
struct mint
{
private:
    u32 data; // in [0,p)

    constexpr static inline i64 p_i64 = static_cast<i64>(p);

public:
    constexpr mint() noexcept
        : data(0) {}

    constexpr mint(i64 const x) noexcept
        : data(static_cast<u32>((x % p_i64 >= 0) ? x % p_i64 : x % p_i64 + p_i64)) {}

    constexpr mint(u32 const x, bool const) noexcept
        : data(x) {}

    // convert to u32
    constexpr u32 const &val() const noexcept
    {
        return data;
    }

    constexpr mint &operator+=(mint const x) noexcept
    {
        data += x.data;
        if (data >= p)
        {
            data -= p;
        }
        return *this;
    }

    constexpr mint &operator-=(mint const x) noexcept
    {
        if (data < x.data)
        {
            data += p;
        }
        data -= x.data;
        return *this;
    }

    constexpr mint &operator*=(mint const x) noexcept
    {
        data = static_cast<u32>(static_cast<u64>(data) * x.data % p);
        return *this;
    }

    constexpr mint &operator/=(mint x)
    {
        if (x.data == 0)
        {
            throw domain_error("Division by mint zero");
        }
        u32 exp = p - 2;
        // (*this) * (x ** exp) : invariant
        while (exp > 0)
        {
            if (exp & 1)
            {
                *this *= x;
            }
            x *= x;
            exp /= 2;
        }
        return *this;
    }

    constexpr mint &operator++() noexcept
    {
        return *this += mint(1, true);
    }

    constexpr mint operator++(int) noexcept
    {
        mint const ret(*this);
        ++(*this);
        return ret;
    }

    constexpr mint &operator--() noexcept
    {
        return *this -= mint(1, true);
    }

    constexpr mint operator--(int) noexcept
    {
        mint const ret(*this);
        --(*this);
        return ret;
    }

    constexpr mint operator-() const noexcept
    {
        return mint(0, true) -= *this;
    }

    constexpr mint operator+(mint const x) const noexcept
    {
        return mint(*this) += x;
    }

    constexpr mint operator-(mint const x) const noexcept
    {
        return mint(*this) -= x;
    }

    constexpr mint operator*(mint const x) const noexcept
    {
        return mint(*this) *= x;
    }

    constexpr mint operator/(mint const x) const
    {
        return mint(*this) /= x;
    }

    // x >= 0 のときべき乗を計算
    constexpr mint pow(u64 exp) const noexcept
    {
        mint ret(1, true), base(*this);
        // ret * (base ** exp) : invariant, == (*this) ** x
        while (exp > 0)
        {
            if (exp & 1)
            {
                ret *= base;
            }
            base *= base;
            exp /= 2;
        }
        return ret;
    }

    constexpr mint inv() const noexcept
    {
        return mint(1, true) /= *this;
    }

    constexpr bool operator==(mint const x) const noexcept
    {
        return data == x.data;
    }
};
#pragma endregion

constexpr u32 mod = 1000'000'007;
using m32 = mint<mod>;

map<i64, int> primes(i64 arg)
{
    map<i64, int> ret;
    auto x = arg;
    for (int p = 2; p * p <= arg; ++p)
    {
        while (x % p == 0)
        {
            x /= p;
            ++ret[p];
        }
    }
    if (x > 1)
    {
        ret[x] = 1;
    }
    return ret;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);

    int n;
    cin >> n;
    vector<i64> a_s(n);
    rep(i, n)
    {
        cin >> a_s[i];
    }
    vector<map<i64, int>> p_s(n);
    map<i64, int> lcmp_s;
    rep(i, n)
    {
        p_s[i] = primes(a_s[i]);
        for (auto [p, c] : p_s[i])
        {
            chmax(lcmp_s[p], c);
        }
    }

    m32 lcm_a = 1;
    for (auto [p, c] : lcmp_s)
    {
        lcm_a *= m32(p).pow(c);
    }

    m32 ans;
    rep(i, n)
    {
        m32 tmp = 1;
        for (auto [p, c] : p_s[i])
        {
            tmp *= m32(p).pow(c);
        }
        ans += lcm_a / tmp;
    }
    cout << ans.val() << endl;

    return 0;
}


Measured memory_bytes: 6780