// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef vector<vector<P>> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<ll> vec;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
const int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30);
const int INF = (1LL << 60);
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}


#include <cstdint>
template <long long Modulus> struct modint {
    long long val;

    constexpr modint(const long long x = 0) noexcept : val((x % Modulus + Modulus) % Modulus) {}

    constexpr modint operator + (const modint rhs) const noexcept { return modint(*this) += rhs; }
    constexpr modint operator - (const modint rhs) const noexcept { return modint(*this) -= rhs; }
    constexpr modint operator * (const modint rhs) const noexcept { return modint(*this) *= rhs; }
    constexpr modint operator / (const modint rhs) const noexcept { return modint(*this) /= rhs; }
    constexpr modint &operator += (const modint rhs) noexcept {
        val += rhs.val;
        if (val >= Modulus) { val -= Modulus; }
        return *this;
    }
    constexpr modint &operator -= (const modint rhs) noexcept {
        if (val < rhs.val) { val += Modulus; }
        val -= rhs.val;
        return *this;
    }
    constexpr modint &operator *= (const modint rhs) noexcept {
        val = val * rhs.val % Modulus;
        return *this;
    }
    constexpr modint &operator /= (modint rhs) noexcept {
        long long exp = Modulus - 2;
        while (exp) {
          if (exp % 2) {
              *this *= rhs;
          }
          rhs *= rhs;
          exp /= 2;
        }
        return *this;
    }
    constexpr bool operator == (const modint rhs) const noexcept { return val == rhs.val; }
    constexpr bool operator != (const modint rhs) const noexcept { return val != rhs.val; }
    friend constexpr ostream& operator << (ostream &os, const modint<MOD>& x) noexcept { return os << x.val; }
    friend constexpr istream& operator >> (istream &is, modint<MOD>& x) noexcept { return is >> x.val; }
    
    friend constexpr modint<MOD> modpow(const modint<MOD> &x, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(x, n / 2);
        t = t * t;
        if (n & 1) t = t * x;
        return t;
    }
    
};
using mint = modint<MOD>;
typedef vector<mint> mvec;
typedef vector<vector<mint>> mvvec;

vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int n;
    cin>>n;
    vector<int> a(n);
    REP(i,n) cin >> a[i];
    vector<long long> num(1100000, 0);
    rep(i,n){
        auto x=prime_factorize(a[i]);
        for(auto p:x) chmax(num[p.fs],p.sc);
    }
    mint lcm=1;
    rep(i,1100000){
        lcm*=modpow(mint(i),num[i]);
    }
    mint ans=0;
    rep(i,n){
        ans+=lcm/a[i];
    }
    cout<<ans<<endl;
    
}

Measured memory_bytes: 8960