#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
#define LINF 1000000000000000000
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

typedef pair<int, int> P;
typedef pair<long long, long long> LLP;

/*
    ユークリッドの互除法（正の整数x, yの最大公約数を返す）
*/

long long gcd(long long x, long long y) {
    if (x < y) swap(x, y);
    while (x % y != 0) {
        long long divisor = x % y;
        x = y;
        y = divisor;
    }
    return y;
}

/*
    最小公倍数を求める
*/

long long lcm(long long x, long long y) {
    long long g = gcd(x, y);
    return g * (x / g) * (y / g);
}

void factorization(vector<LLP>& llp, long long n) {
    if (n <= 1) return;
    long long n2 = n;
    for (long long i = 2; i * i <= n ; i++) {
        int count = 0;
        while (n2 % i == 0) {
            n2 = n2 / i;
            count ++;
        }
        if (count > 0) {
            LLP temp;
            temp.first = i;
            temp.second = count;
            llp.push_back(temp);
        }
    }
    if (n2 > 1) {
        LLP temp;
        temp.first = n2;
        temp.second = 1;
        llp.push_back(temp);
    }
}

vector<LLP> check(vector<LLP> x, vector<LLP>y) {
    vector<LLP> ans;
    long long x_index = 0;
    long long y_index = 0;
    while (x_index < x.size() || y_index < y.size()) {
        if (x_index < x.size() && y_index < y.size()) {
            if (x[x_index].first < y[y_index].first) {
                ans.push_back(make_pair(x[x_index].first, x[x_index].second));
                x_index++;
            } else if (x[x_index].first > y[y_index].first) {
                ans.push_back(make_pair(y[y_index].first, y[y_index].second));
                y_index++;
            } else {
                ans.push_back(make_pair(x[x_index].first, max(x[x_index].second, y[y_index].second)));
                x_index++;
                y_index++;
            }
        } else {
            if (x_index >= x.size()) {
                ans.push_back(make_pair(y[y_index].first, y[y_index].second));
                y_index++;
            } else {
                ans.push_back(make_pair(x[x_index].first, x[x_index].second));
                x_index++;
            }
        }
    }
    return ans;
}

int main() {

    int N;
    cin >> N;
    vector<int> A(N);
    int maximum = 0;
    rep(i,N) {
        cin >> A[i];
        maximum = max(maximum, A[i]);
    }

    if (maximum == 1) {
        cout << N << endl;
        return 0;
    }

    vector<LLP> l;
    factorization(l, maximum);
    rep(i,N) {
        if (A[i] == 1) continue;
        vector<LLP> m;
        factorization(m, A[i]);
        l = check(l, m);
    }
    long long ans = 0;
    long long lc = 1;
    rep(i,l.size()) {
        rep(j,l[i].second) {
            lc = lc * l[i].first % MOD;
        }
    }

    rep(i,N) {
        if (A[i] == 1) {
            ans = (ans + lc) % MOD;
        } else {
            long long c = 1;
            vector<LLP> x;
            factorization(x, A[i]);
            int x_index = 0;
            int l_index = 0;
            
            while (x_index < x.size() || l_index < l.size()) {
                if (x_index < x.size() && l_index < l.size()) {
                    if (x[x_index].first < l[l_index].first) {
                        rep(j,l[l_index].second) {
                            c = c * l[l_index].first % MOD;
                        }
                        l_index++;
                    } else if (x[x_index].first > l[l_index].first) {
                        rep(j,l[l_index].second) {
                            c = c * l[l_index].first % MOD;
                        }
                        l_index++;
                    } else {
                        rep(j,l[l_index].second - x[x_index].second) {
                            c = c * l[l_index].first % MOD;
                        }\
                        x_index++;
                        l_index++;
                    }
                } else {
                    if (x_index >= x.size()) {
                        rep(j,l[l_index].second) {
                            c = c * l[l_index].first % MOD;
                        }
                        l_index++;
                    }
                }
            }
            ans = (ans + c) % MOD;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1216