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


//TEMPLATE
#define pb              push_back
#define mp              make_pair
#define ll              long long
#define ld              long double
//#define pi              3.1415926536
#define pi              acos(-1)
#define newline         printf("\n")
#define printminusone   printf("-1\n")
#define scl1(n)         scanf("%lld", &n)
#define scl2(a, b)      scanf("%lld %lld", &a, &b)
#define scl3(a, b, c)   scanf("%lld %lld %lld", &a, &b, &c)
#define printl(n)       printf("%lld\n", n)
#define ssl1(str)       scanf(" %[^\n]", str)
#define scd1(n)         scanf("%lf", &n)
#define scd2(a, b)      scanf("%lf %lf", &a, &b)
#define printd(n)       printf("%lf\n", n)
#define printld(n)      printf("%Lf\n", n)
#define printcase       printf("Case %lld: ", i)
#define reversed(s)     reverse(s.begin(), s.end())
#define asort(s)        sort(s.begin(), s.end())
#define dsort(s)        sort(s.rbegin(), s.rend())
#define for0(i, n)      for (i = 0; i < n; i++)
#define for1(i, n)      for (i = 1; i <= n; i++)
#define fori(itt, stt)  for(auto itt = stt.begin(); itt != stt.end(); itt++)
#define pii             pair <ll, ll>
#define piii            pair <ll, pii>
#define F               first
#define S               second
#define FR              ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ms(arr, x)      memset(arr, x, sizeof arr)
#define bitcount(n)     __builtin_popcountll(n)
#define all(s)          s.begin(), s.end()

const ll INF = LLONG_MAX;
const ll SZ = 1e6+5;
const ll mod = 1e9+7;


ll c1, c2;
ll ex_euclid(ll a, ll b) {
    if(b == 0) {
        c1 = 1;
        c2 = 0;
        return a;
    }

    ll g = ex_euclid(b, a%b);

    ll x1 = c1;
    c1 = c2;
    c2 = x1 - c2 * (a/b);

    return g;
}

ll mod_inverse(ll a, ll m) {
    ll g = ex_euclid(a, m);

    return ((c1%m) + m) % m;
}

bool st[SZ];
vector <ll> prime;
void sieve() {
    ll i, j;

    st[0] = st[1] = 1;
    for(i = 2; i*i < SZ; i++) {
        if(!st[i]) {
            for(j = i*i; j < SZ; j += i) st[j] = 1;
        }
    }

    prime.pb(2);
    for(i = 3; i < SZ; i += 2) {
        if(!st[i]) prime.pb(i);
    }
}

ll bigmod(ll x, ll y) {
    if(y == 0) return 1;

    ll res = bigmod(x, y/2);
    res = (res *res) % mod;
    if(y%2 == 1) res = (res * x) % mod;

    return res;
}

ll a[SZ], mx[SZ];

void factorize(ll n) {
    ll sqrtn = sqrt(n);

    for(ll i = 0; i < prime.size() && prime[i] <= sqrtn; i++) {
        if(n%prime[i] == 0) {
            ll c = 0;
            while(n%prime[i] == 0) {
                n /= prime[i];
                c++;
            }
            mx[prime[i]] = max(mx[prime[i]], c);
        }
    }
    if(n > 1) mx[n] = max(mx[n], 1LL);
}

int main() {
    sieve();
    ll t = 0, n, x, y, z, i, j, k, g, p, q, ans = 0, sum = 0, c = 0;
    string s, s1, s2;

    scl1(n);
    for1(i, n) scl1(a[i]);

    for1(i, n) factorize(a[i]);

    p = 1;
    for0(i, prime.size()) {
        p *= bigmod(prime[i], mx[prime[i]]);
        p %= mod;
    }

    for1(i, n) {
        x = mod_inverse(a[i], mod);
        y = (p*x) % mod;
        ans = (ans + y) % mod;
    }

    printl(ans);

    return 0;
}



Measured memory_bytes: 8688