#include <bits/stdc++.h>
using namespace std;

template <long long mod>
class Mod
{
    long long value;
    void set_value(const long long x)
    {
        this->value = x % mod;
    }

public:
    Mod()
    {
        set_value(0ll);
    }

    template <typename T>
    Mod(T x = 0)
    {
        set_value((long long)x);
    }

    friend istream &operator>>(istream &is, Mod &x)
    {
        long long tmp;
        is >> tmp;
        x.set_value(tmp);
        return is;
    }

    friend ostream &operator<<(ostream &os, const Mod &x)
    {
        os << x.value;
        return os;
    }

    operator long long() const
    {
        return this->value;
    }

    template <typename T>
    bool operator<(const T x)
    {
        return this->value < (long long)x;
    }

    template <typename T>
    bool operator<=(const T x)
    {
        return this->value <= (long long)x;
    }

    template <typename T>
    bool operator>(const T x)
    {
        return this->value > (long long)x;
    }

    template <typename T>
    bool operator>=(const T x)
    {
        return this->value >= (long long)x;
    }

    template <typename T>
    bool operator==(const T x)
    {
        return this->value == (long long)x;
    }

    template <typename T>
    Mod &operator=(const T x)
    {
        set_value((long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator&=(const T x)
    {
        set_value(this->value & (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator|=(const T x)
    {
        set_value(this->value | (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator^=(const T x)
    {
        set_value(this->value ^ (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator<<=(const T x)
    {
        set_value(this->value << (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator>>=(const T x)
    {
        set_value(this->value >> (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator+=(const T x)
    {
        set_value(this->value + (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator-=(const T x)
    {
        set_value(this->value - (long long)x + mod);
        return *this;
    }

    template <typename T>
    Mod &operator*=(const T x)
    {
        set_value(this->value * (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator/=(const T x)
    {
        long long a = (long long)x;
        long long b = mod;
        long long u = 1;
        long long v = 0;
        while (b)
        {
            long long t = a / b;
            a -= t * b;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        u %= mod;
        if (u < 0)
            u += mod;
        *this *= Mod(u);
        return *this;
    }

    template <typename T>
    Mod operator&(const T x) const
    {
        return Mod(*this) &= x;
    }

    template <typename T>
    Mod operator|(const T x) const
    {
        return Mod(*this) |= x;
    }

    template <typename T>
    Mod operator^(const T x) const
    {
        return Mod(*this) ^= x;
    }

    template <typename T>
    Mod operator<<(const T x) const
    {
        return Mod(*this) <<= x;
    }

    template <typename T>
    Mod operator>>(const T x) const
    {
        return Mod(*this) >>= x;
    }

    template <typename T>
    Mod operator+(const T x) const
    {
        return Mod(*this) += x;
    }

    template <typename T>
    Mod operator-(const T x) const
    {
        return Mod(*this) -= x;
    }

    template <typename T>
    Mod operator*(const T x) const
    {
        return Mod(*this) *= x;
    }

    template <typename T>
    Mod operator/(const T x) const
    {
        return Mod(*this) /= x;
    }

    Mod &operator++()
    {
        *this += 1;
        return *this;
    }

    Mod &operator--()
    {
        this->set_value(--this->value);
        return *this;
    }

    Mod operator++(auto)
    {
        Mod ret(*this);
        ++*this;
        return ret;
    }

    Mod operator--(auto)
    {
        Mod ret(*this);
        --*this;
        return ret;
    }
};

template <typename T>
T calc_gcd(T x, T y)
{
    if (x < y)
    {
        swap(x, y);
    }
    T remain = x % y;
    while (remain != 0)
    {
        x = y;
        y = remain;
        remain = x % y;
    }
    return y;
}

template <typename T>
T calc_multi_gcd(vector<T> x)
{
    if (x.size() < 2)
    {
        if (x.size() == 1)
        {
            return x[0];
        }
        else
        {
            return -1;
        }
    }

    T gcd = calc_gcd(x[0], x[1]);
    for (long long i = 2; i < x.size(); i++)
    {
        gcd = calc_gcd(gcd, x[i]);
    }
    return gcd;
}

template <typename T>
T calc_lcm(T x, T y)
{
    if (x < y)
    {
        swap(x, y);
    }
    T ret = x / calc_gcd(x, y);
    return ret * y;
}

template <typename T>
T calc_multi_lcm(vector<T> x)
{
    if (x.size() < 2)
    {
        if (x.size() == 1)
        {
            return x[0];
        }
        else
        {
            return -1;
        }
    }

    T lcm = calc_lcm(x[0], x[1]);
    for (long long i = 2; i < x.size(); i++)
    {
        lcm = calc_lcm(lcm, x[i]);
    }
    return lcm;
}

template <typename T>
vector<pair<T, int>> prime_factorization(T x)
{
    vector<pair<T, int>> ret;
    for (T i = 2; i * i <= x; i++)
    {
        int count = 0;
        while (x % i == 0)
        {
            count++;
            x /= i;
        }
        if (count > 0)
        {
            ret.push_back(make_pair(i, count));
        }
    }
    if (x != 1)
    {
        ret.push_back(make_pair(x, 1));
    }
    return ret;
}

template <typename T, typename U>
T power(T x, U y)
{
    T ret;
    ret = 1;
    while (y > 0)
    {
        if ((y & 1) > 0)
        {
            ret *= x;
        }
        x *= x;
        y >>= 1;
    }
    return ret;
}
int main()
{
    const long long MOD = 1e9 + 7;
    int N;
    cin >> N;
    vector<int> A(N);
    vector<int> dp(1e6 + 5, 0);
    for (int &a : A)
    {
        cin >> a;
        vector<pair<int, int>> ret = prime_factorization(a);
        for (pair<int, int> p : ret)
        {
            dp[p.first] = max(dp[p.first], p.second);
        }
    }

    Mod<MOD> lcm = 1;
    for (int i = 0; i < dp.size(); i++)
    {
        lcm *= power(Mod<MOD>(i), dp[i]);
    }
    Mod<MOD> ans = 0;
    for (long long a : A)
    {
        ans += lcm / a;
    }
    cout << ans << endl;
}


Measured memory_bytes: 4224