#include <vector>
#include <array>
#include <map>
#include <unordered_map>
#include <numeric>
#include <iostream>
#include <cmath>

using prime_map = std::map<int, int>;

const int MAX_A = 1000000;
const uint_fast64_t MOD = 1000000007;


prime_map prime_list;


void print(const prime_map &P)
{
    for(auto p : P)
    {
        std::cout << p.first << " " << p.second << std::endl;
    }
}

template<class T>
void swap(T &a, T &b)
{
    T t = a;
    a = b;
    b = t;
}

template<int MAX_N>
class Factoriser
{
    std::array<int, MAX_N+1> factors;
    bool isFactorsGenerated = false;
    
    void generateFactors()
    {
        int sqrN = static_cast<int>(std::sqrt(MAX_N));
        
        for(int i = 2; i <= MAX_N; ++i)
        {
            factors[i] = 0;
        }
        
        for(int i = 2; i <= sqrN; ++i)
        {
            if(factors[i] == 0)
            {
                for(int j = i * 2; j <= MAX_N; j += i)
                {
                    if(factors[j] == 0)
                    {
                        factors[j] = i;
                    }
                }
            }
        }
        isFactorsGenerated = true;
    }
    
    public:
    
    prime_map Factorise(int M)
    {
        if(!isFactorsGenerated)
        {
            generateFactors();
        }
        
        prime_map P;
        
        int mm = M;
        
        while(factors[mm])
        {
            ++P[factors[mm]];
            mm /= factors[mm];
        }
        
        if(mm >= 2) ++P[mm];
        
        return P;
    }
    
};

template<class StoreT, class AddT, class MulT, StoreT MOD>
class ModInt
{
    using self_type = ModInt<StoreT, AddT, MulT, MOD>;
    StoreT i;
    
public:
    ModInt(StoreT i)
        : i(i)
    {}

    ModInt(const self_type &i)
        : i(i.i)
    {}
    
    constexpr uint_fast32_t getI() const noexcept
    {
        return i;
    }
    
    ModInt &operator +=(self_type rhs)
    {
        AddT i64 = static_cast<AddT>(i);
        StoreT a32 = static_cast<StoreT>((i64 + rhs.i) % MOD);
        i = a32;
        return *this;
    }
    
    constexpr ModInt operator +(self_type rhs) const noexcept
    {
        self_type newInt(*this);
        newInt += rhs;
        return newInt;
    }
    
    ModInt &operator *=(self_type rhs)
    {
        MulT i64 = static_cast<MulT>(i);
        StoreT a32 = static_cast<StoreT>((i64 * rhs.i) % MOD);
        i = a32;
        return *this;
    }
    
    constexpr ModInt operator *(self_type rhs) const noexcept
    {
        self_type newInt(*this);
        newInt *= rhs;
        return newInt;
    }
    
    constexpr ModInt operator /(self_type rhs) const noexcept
    {
        self_type newInt(*this);
        self_type rhsInv = rhs.inv();
        newInt *= rhsInv;
        return newInt;
    }
    
    constexpr ModInt pow(int n) const noexcept
    {
        ModInt a = *this;
        ModInt res = 1;
        
        while (n > 0)
        {
            if (n & 1)
            {
                res *= a;
            }
            a *= a;
            n >>= 1;
        }
        return res;
    }
    
    constexpr self_type inv() const noexcept
    {
        /*
        StoreT a = i, b = MOD, u = 1, v = 0;
        while(b)
        {
            StoreT t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        u %= MOD; 
        if (u < 0) u += MOD;
        return self_type(u);
        */
        return pow(MOD-2);
    }
};

template<class StoreT, class AddT, class MulT, StoreT MOD>
std::ostream &operator <<(std::ostream &ost, ModInt<StoreT, AddT, MulT, MOD> i)
{
    ost << i.getI();
    return ost;
}

using MyModInt = ModInt<uint_fast32_t, uint_fast32_t, uint_fast64_t, MOD>;

template<class T, class Key>
typename T::mapped_type at_or_default(const T &c, Key key)
{
    auto i = c.find(key);
    if( i != c.end() )
    {
        return i->second;
    }
    else
    {
        return 0;
    }
}

/*
prime_map listPrimes(int N)
{
    int sqrN = static_cast<int>(std::sqrt(N));
    prime_map P;
    
    for(int i = 2; i <= sqrN; ++i)
    {
        P[i] = 0;
    }
    
    for(int i = 2; i <= sqrN; ++i)
    {
        if(P[i] == 0)
        {
            for(int j = i * 2; j <= sqrN; j += i)
            {
                ++P[j];
            }
        }
    }
    
    prime_map PP;
    for(auto p : P)
    {
        if(p.second == 0)
        {
            PP.insert(p);
        }
    }
    
    prime_list = PP;
    return PP;
}

prime_map factorise(int M)
{
    prime_map P = prime_list;
    
    int mm = M;
    
    for(auto &p : P)
    {
        while(mm && mm % p.first == 0)
        {
            ++p.second;
            mm = mm / p.first;
        }
    }
    
    if(mm >= 2) P[mm] = 1;
    
    return P;
}
*/
    
void prime_map_max(prime_map &PMax, const prime_map &P)
{
    for(auto &p : PMax)
    {
        auto it = P.find(p.first);
        if(it != P.end() && p.second < it->second)
        {
            p.second = it->second;
        }
    }
    
    for(auto p : P)
    {
        if(PMax.find(p.first) == PMax.end())
        {
            PMax[p.first] = p.second;
        }
    }
}

MyModInt prime_map_diff(const prime_map &P1, const prime_map &P2)
{
    MyModInt b = 1;
    for(auto p : P1)
    {
        int diff = p.second - at_or_default(P2, p.first);
        MyModInt pi = p.first;
        b *= pi.pow(diff);
    }
    return b;
}

MyModInt prime_map_mul(const prime_map &P)
{
    MyModInt ans = 1;
    for(auto p : P)
    {
        if(p.second > 0)
        {
            MyModInt pi = p.first;
            ans *= pi.pow(p.second);
        }
    }
    return ans;
}

int main()
{
    int M;
    std::cin >> M;
    
    std::vector<int> A(M);
    for(int i = 0; i < M; ++i)
    {
        std::cin >> A[i];
    }
    
    Factoriser<MAX_A> fac;
    std::vector<prime_map> PA(M);
    prime_map PMax;
    
    for(int i = 0; i < M; ++i)
    {
        PA[i] = fac.Factorise(A[i]);
        prime_map_max(PMax, PA[i]);
    }

    MyModInt LCM = prime_map_mul(PMax);
    MyModInt BSum = std::accumulate(
        begin(PA), end(PA), MyModInt(0), 
        [LCM](MyModInt v, const prime_map &P)
        {
            return v + LCM / prime_map_mul(P);
        });
    std::cout << BSum << std::endl;
}

Measured memory_bytes: 7040