#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww
{
    cww()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
} star;
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<char> vchar;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit()
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
long long COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
class Fraction
{
private:
    long long numer; // 分子
    long long denom; // 分母

    friend const bool operator==(const Fraction &a, const Fraction &b);
    friend const bool operator!=(const Fraction &a, const Fraction &b);
    friend const bool operator>=(const Fraction &a, const Fraction &b);
    friend const bool operator<=(const Fraction &a, const Fraction &b);
    friend const bool operator>(const Fraction &a, const Fraction &b);
    friend const bool operator<(const Fraction &a, const Fraction &b);

    friend const Fraction operator+(const Fraction &a, const Fraction &b);
    friend const Fraction operator-(const Fraction &a, const Fraction &b);
    friend const Fraction operator*(const Fraction &a, const Fraction &b);
    friend const Fraction operator/(const Fraction &a, const Fraction &b);

public:
    Fraction();
    Fraction(long long);
    Fraction(long long, long long);
    Fraction(const Fraction &);

    void set(long long, long long);
    void set(const Fraction &);
    void setNumer(long long);
    void setDenom(long long);

    long long getNumer();
    long long getDenom();

    static long long gcd(long long, long long); // 最大公約数
    static long long lcm(long long, long long); // 最小公倍数
    void normal();                              // 約分

    std::string toString();
    long double toLongDouble();

    bool equals(const Fraction &) const;
    long long compare(const Fraction &) const;

    Fraction &operator=(const Fraction &b);

    Fraction &operator+=(const Fraction &b);
    Fraction &operator-=(const Fraction &b);
    Fraction &operator*=(const Fraction &b);
    Fraction &operator/=(const Fraction &b);

    Fraction operator+();
    Fraction operator-();

    Fraction &operator++();
    Fraction operator++(int);

    Fraction &operator--();
    Fraction operator--(int);
};
long long Fraction::gcd(long long a, long long b)
{
    a = abs(a);
    b = abs(b);
    if (a < b)
        std::swap(a, b);

    long long tmp;
    while (b != 0)
    {
        tmp = b;
        b = a % b;
        a = tmp;
    }

    return a;
}
long long Fraction::lcm(long long a, long long b)
{
    a = abs(a);
    b = abs(b);
    if (a > b)
        std::swap(a, b);

    if (a == 1)
        return b;

    long long i = a;
    while (i % b != 0)
    {
        i += a;
    }
    return i;
}

Fraction::Fraction()
{
    set(0, 1);
}
Fraction::Fraction(long long n)
{
    set(n, 1);
}
Fraction::Fraction(long long numer, long long denom)
{
    set(numer, denom);
}
Fraction::Fraction(const Fraction &b)
{
    set(b);
}

void Fraction::set(long long numer, long long denom)
{
    this->numer = numer;
    this->denom = denom;
    normal();
}
void Fraction::set(const Fraction &b)
{
    this->numer = b.numer;
    this->denom = b.denom;
}
void Fraction::setNumer(long long numer)
{
    this->numer = numer;
    normal();
}
void Fraction::setDenom(long long denom)
{
    this->denom = denom;
    normal();
}

inline long long Fraction::getNumer()
{
    return numer;
}
inline long long Fraction::getDenom()
{
    return denom;
}

void Fraction::normal()
{
    long long gcd = this->gcd(getNumer(), getDenom());

    if (gcd == 1)
    {
        // 分母は常に正
        if (denom < 0)
        {
            numer *= -1;
            denom *= -1;
        }

        return;
    }

    long long numer = getNumer() / gcd;
    long long denom = getDenom() / gcd;

    // 分母は常に正
    if (denom < 0)
    {
        numer *= -1;
        denom *= -1;
    }

    set(numer, denom);
}

std::string Fraction::toString()
{
    std::string str = "";

    if (getDenom() == 1)
        str = std::to_string(getNumer());
    else
        str = std::to_string(getNumer()) + "/" + std::to_string(getDenom());

    return str;
}
long double Fraction::toLongDouble()
{
    return (long double)getNumer() / getDenom();
}

bool Fraction::equals(const Fraction &b) const
{
    return numer == b.numer && denom == b.denom;
}
long long Fraction::compare(const Fraction &b) const
{
    long long lcm = this->lcm(denom, b.denom);

    return (lcm / denom) * numer - (lcm / b.denom) * b.numer;
}

const bool operator==(const Fraction &a, const Fraction &b) { return a.equals(b); }
const bool operator!=(const Fraction &a, const Fraction &b) { return !a.equals(b); }
const bool operator>=(const Fraction &a, const Fraction &b) { return a.compare(b) >= 0; }
const bool operator<=(const Fraction &a, const Fraction &b) { return a.compare(b) <= 0; }
const bool operator>(const Fraction &a, const Fraction &b) { return a.compare(b) > 0; }
const bool operator<(const Fraction &a, const Fraction &b) { return a.compare(b) < 0; }

Fraction &Fraction::operator=(const Fraction &b)
{
    this->set(b);

    return *this;
}

const Fraction operator+(const Fraction &a, const Fraction &b)
{
    long long lcm = Fraction::lcm(a.denom, b.denom);
    long long numer = a.numer * (lcm / a.denom) + b.numer * (lcm / b.denom);

    return Fraction(numer, lcm);
}
const Fraction operator-(const Fraction &a, const Fraction &b)
{
    return operator+(a, Fraction(-b.numer, b.denom));
}
const Fraction operator*(const Fraction &a, const Fraction &b)
{
    long long gcd = Fraction::gcd(a.numer, b.denom);
    long long numer = a.numer / gcd;
    long long denom = b.denom / gcd;

    gcd = Fraction::gcd(b.numer, a.denom);
    numer *= b.numer / gcd;
    denom *= a.denom / gcd;

    return Fraction(numer, denom);
}
const Fraction operator/(const Fraction &a, const Fraction &b)
{
    return operator*(a, Fraction(b.denom, b.numer));
}

Fraction &Fraction::operator+=(const Fraction &b) { return *this = *this + b; }
Fraction &Fraction::operator-=(const Fraction &b) { return *this = *this - b; }
Fraction &Fraction::operator*=(const Fraction &b) { return *this = *this * b; }
Fraction &Fraction::operator/=(const Fraction &b) { return *this = *this / b; }

Fraction Fraction::operator+() { return Fraction(this->numer, this->denom); };
Fraction Fraction::operator-() { return Fraction(-(this->numer), this->denom); };

Fraction &Fraction::operator++() { return *this += 1; }
Fraction &Fraction::operator--() { return *this += -1; }
Fraction Fraction::operator++(int)
{
    Fraction tmp = *this;
    *this += 1;
    return tmp;
}
Fraction Fraction::operator--(int)
{
    Fraction tmp = *this;
    *this += -1;
    return tmp;
}
map<ll, int> prime_factor(ll n)
{
    map<ll, int> 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;
}
template <int mod>
struct ModInt
{
    ll x;

    constexpr ModInt(ll a = 0) noexcept
    {
        x = a % mod;
    }
    constexpr ll value() noexcept
    {
        return x;
    }
    constexpr const ll value() const noexcept
    {
        return x;
    }
    constexpr ModInt Pow(ll n) noexcept
    {
        ModInt<mod> ans(1), mul(x);
        for (int i = 0; i < 31; i++)
        {
            if (n & (1 << i))
            {
                ans *= mul;
            }
            mul *= mul;
        }
        return ans;
    }
    constexpr ModInt &operator+=(const ModInt y) noexcept
    {
        x += y.x;
        if (x >= mod)
        {
            x -= mod;
        }
        return *this;
    }
    constexpr ModInt &operator-=(const ModInt y) noexcept
    {
        if (x < y.x)
        {
            x += mod;
        }
        x -= y.x;
        return *this;
    }
    constexpr ModInt &operator*=(const ModInt y) noexcept
    {
        x = x * y.x % mod;
        return *this;
    }
    constexpr ModInt factorial() noexcept
    {
        int k = x;
        ModInt<mod> tmp(x);
        for (int i = 1; i < k; i++)
        {
            tmp *= ModInt<mod>(k - i);
        }
        return tmp;
    }
    constexpr const ModInt inverse() noexcept
    {
        return this->Pow(mod - 2);
    }
    constexpr ModInt &operator/=(ModInt y) noexcept
    {
        *this *= y.inverse();
        return *this;
    }
    constexpr ModInt operator+(const ModInt y) const noexcept
    {
        return ModInt(*this) += y;
    }
    constexpr ModInt operator*(const ModInt y) const noexcept
    {
        return ModInt(*this) *= y;
    }
    constexpr ModInt operator-(const ModInt y) const noexcept
    {
        return ModInt(*this) -= y;
    }
    constexpr ModInt operator/(const ModInt y) const noexcept
    {
        return *this /= y;
    }
};
int main()
{
    int N;
    cin >> N;
    vint A(N);
    map<ll, int> pr;
    rep(i, N)
    {
        cin >> A[i];
    }
    vector<map<ll, int>> prA(N);
    ModInt<(int)1e9 + 7> ans(0);
    rep(i, N)
    {
        prA[i] = prime_factor(A[i]);
        for (auto j : prA[i])
        {
            pr[j.first] = max(pr[j.first], j.second);
        }
    }
    ModInt<MOD> lcm(1);
    for (auto i : pr)
    {
        lcm *= ModInt<MOD>(i.first).Pow(i.second);
    }
    ModInt<MOD> sum(0), tmp(0);
    rep(i, N)
    {
        tmp = lcm * ModInt<MOD>(A[i]).inverse();
        sum += tmp;
        tmp = ModInt<MOD>(0);
    }
    cout << sum.value();
    return 0;
}

Measured memory_bytes: 3840