// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



#define fr(i,n) _back

#define pb	push_back

#define eb	emplace_back

#define mk	make_pair

#define fi	first

#define se	second

#define endl	'\n'



typedef long long ll;

typedef pair<int,int> ii;

typedef vector<ii> vii;

const int INF = 0x3f3f3f3f;

const double PI = acos(-1.0);

const ll MOD = 1e9 + 7;

const int T = 1e4 + 3;

const int N = 1e3 + 2;

const int OK = 1e6 + 10;



bitset<N> crivo;

int maxDiv[OK];

vector<int> primes;

ll v[T];



void init() {

    for(int i = 2; i < N; i++) {

        if(!crivo[i]) {

            primes.pb(i);

            for(int j = i+i; j < N; j += i) crivo[j] = 1;

        }

    }

}



ll expo(ll base, ll e) {

    ll ans = 1;

    while(e) {

        if(e&1) ans = (ans * base) % MOD;

        base = (base * base) % MOD;

        e >>= 1;

    }

    return ans;

}



void decop(int x) {

    for(int i = 0; i < primes.size() and primes[i]*primes[i] <= x; i++) {

        int d = 0;

        while(x % primes[i] == 0) d++, x /= primes[i];

        maxDiv[primes[i]] = max(maxDiv[primes[i]], d);

    }

    if(x > 1) maxDiv[x] = max(maxDiv[x],1);

}



int main() {

    ios_base::sync_with_stdio(false);

    init();

    int n; cin >> n;

    ll tira = 0;



    for(int i = 0; i < n; i++) {

        cin >> v[i];

        decop(v[i]);

    }



    ll acum = 1;

    for(ll i = 0; i < OK; i++) {

        ll ok = 1;

        while(maxDiv[i]) ok = (ok * i) % MOD, maxDiv[i]--;

        if(ok > 1) acum = (acum * ok)%MOD;

    }



    ll ans = 0;

    for(int i = 0; i < n; i++) {

        ll ok = (acum*expo(v[i],MOD-2))%MOD;

        ans = (ans + ok) % MOD;

    }

    cout << ans << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



using namespace std;

typedef long long ll;



#ifdef ZERO_IQ

ios_base::sync_with_stdio ( false ), cin.tie ( 0 ), cout.tie ( 0 );

#endif



long long const mod = 1e9 + 7;



map<ll, ll> primefactorization(ll n) {

    map<ll, ll> primefactors;

    while (n % 2 == 0) {

        primefactors[2]++;

        n /= 2;

    }

    for (int i = 3; i <= sqrt(n); ++i) {

        while (n % i == 0) {

            primefactors[i]++;

            n /= i;

        }

    }

    if (n > 1)primefactors[n]++;

    return primefactors;

}





ll fp(ll base, ll exp) {

    if (exp == 0)

        return 1;

    ll ans = fp(base, exp / 2);

    ans = (ans * ans) % mod;

    if (exp % 2 != 0)

        ans = (ans * (base % mod)) % mod;

    return ans;

}



int main() {

    int n;

    cin >> n;

    vector<int> v;

    for (int i = 0; i < n; ++i) {

        ll q;

        cin >> q;

        v.push_back(q);

    }

    if (n == 1) {

        return cout << 1, 0;

    }

    map<ll, ll> final;

    for (int j = 0; j < n; ++j) {

        map<ll, ll> fakeone = primefactorization(v[j]);

        for (auto i:fakeone) {

            final[i.first] = max(final[i.first], i.second);

        }

    }

    ll res = 1;

    for (auto i:final) {

        for (int j = 0; j < i.second; ++j) {

            res = ((res % mod) * (i.first % mod)) % mod;

        }

        //cout<<i.first<<" "<<i.second<<endl;

    }

    //cout<<res<<endl;

    ll outt=0;

    for (int k = 0; k < n; ++k) {

         outt=((outt%mod)+((res%mod)*(fp(v[k],mod-2)))%mod)%mod;

    }

    cout<<outt;



    return 0;

}

// Fastest known solution for this problem: