#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >
#define endl '\n'

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

template<class U, class V>
istream& operator >>(istream& in, pair<U, V>& pr) {
    return in >> pr.first >> pr.second;
}

template<class U, class V>
ostream& operator <<(ostream& out, pair<U, V>& p) {
    return out << p.first << " " << p.second;
}

template<class T>
ostream& operator <<(ostream& out, vector<T> vec) {
    for (T& e : vec)
        out << e << " ";
    return out << endl;
}

// ---- BEGIN LIBRARY CODE ----
class Primes
{
public:
    Primes()
    {
        _factors = vector<int>(1, 1);
    }

    /**
     * Returns a vector of all primes <= m for some m >= n.
     */
    vector<int> getPrimes(int n)
    {
        computeInternal(n);
        vector<int> primes;
        for (int p = 2;p <= n; p++)
            if (_factors[p] == p)
                primes.push_back(p);
        return primes;
    }

    /**
     * Returns a vector consisting of single prime for each integer <= m
     * for some m >= n. Using this array, any integer in this range can be
     * completely factorized.
     */
    const vector<int> factorizeRange(int n)
    {
        computeInternal(n);
        return _factors;
    }

private:
    void computeInternal(int n)
    {
        if (_factors.size() > n)
            return;
        _factors.resize(n + 1);
        n = _factors.size() - 1;

        for (int p = 1;p <= n; p++)
            _factors[p] = p;

        for (int p = 2;p <= n; p++)
            if (_factors[p] == p)
                for (int q = 2 * p;q <= n;q += p)
                    _factors[q] = p;

        return;
    }

    vector<int> _factors;
};

class ModuloMath
{
public:
    ModuloMath(int _MOD)
    {
        _MODULO = _MOD;
    }
    int modAdd(int x, int y)
    {
        lint ret = x;
        ret += y;
        return (int) (ret % _MODULO);
    }

    int modSub(int x, int y)
    {
        lint ret = x;
        ret += _MODULO - y;
        return (int) (ret % _MODULO);
    }

    int modMul(int x, int y)
    {
        lint ret = x * 1LL * y;
        return (int) (ret % _MODULO);
    }

    int modExp(int a, int x)
    {
        // x ^ y % MOD
        int ret = 1, tmp = a;
        while (x > 0) {
            if (x % 2 == 1)
                ret = modMul(ret, tmp);
            tmp = modMul(tmp, tmp);
            x /= 2;
        }

        return ret;
    }

private:
    // Internal state.
    int _MODULO;
};
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int N;
    cin >> N;
    VEC(int) A(N);
    READVEC(A);

    Primes primes;
    VEC(int) factors = primes.factorizeRange(1000001);
    map<int, int> lcm;
    for (int a : A) {
        int tmp = a;
        while (tmp > 1) {
            int e = 0, f = factors[tmp];
            while (tmp % f == 0)
                tmp /= f, e++;

            lcm[f] = max(lcm[f], e);
        }
    }

    const lint MOD = 1000000007;

    lint k = 1;
    for(auto& pr : lcm) {
        int f = pr.first, e = pr.second;
        while (e--)
            k = k * f % MOD;
    }

    lint ret = 0;
    ModuloMath math((int)MOD);
    for (int a : A) {
        lint t = k * math.modExp(a, MOD - 2) % MOD;
        ret = (ret + t) % MOD;
    }
    cout << ret << endl;

    return 0;
};

Measured memory_bytes: 8576