#include <bits/stdc++.h>
using namespace std;
#define testing 0
#define FOR(ii, ss, ee) for(ll ii = (ss); ii <= (ll)(ee); ++ii)
#define DEC(ii, ss, ee) for(ll ii = (ss); ii >= (ll)(ee); --ii)
#define IAMSPEED ios_base::sync_with_stdio(false); cin.tie(0);
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << " , " << #y << "=" << y << endl
#define db3(a,b,c) cerr<<#a<<"="<<a<<","<<#b<<"="<<b<<","<<#c<<"="<<c<<endl
#define dbv(v) cerr << #v << ":"; for (auto i : v) cerr << i << ' '; cerr << endl
#define dbvp(v) cerr << #v << ":"; for (auto i : v) cerr << "{"  << i.f << ',' << i.s << "} "; cerr << endl
#define dba(a,ss,ee) cerr << #a << ":"; FOR(i,ss,ee) cerr << a[i] << ' '; cerr << endl
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long 
#define pb push_back
#define inf (int)1e9
#define oo (ll)1e18
#define all(x) (x).begin(), (x).end()
#define f first
#define s second
#define reach cerr << "hi\n";
typedef pair <int, int> pi;
typedef pair <ll,ll> pl;
typedef pair <pi, int> pii;
typedef tuple<int,int,int> ti3;
string lts(ll x) {stringstream s; s << x; return s.str(); }
ll stl(string x) {stringstream s(x); ll temp; s >> temp; return temp; }
string cts(char x) {string s(1,x); return s;}
const int MOD = 1e9 + 7;
template <typename T> void maxself(T& a, T b) {
	a = max(a, b);
}
template <typename T> void minself(T& a, T b) {
	a = min(a, b);
}
#define MAXN (int)1e4+5
#if !testing
	#define cerr if(0)cout
#endif

bitset<MAXN+1> isPrime;
vector<int> primeList;

ll A[MAXN];
unordered_map<int,int> mp;

vector<int> primeFactorize(int X) {
    vector<int> result;
    for (auto it = primeList.begin(); it != primeList.end(); ++it) {
        if (*it > X/(*it)) break; 
        while (X % *it == 0) { 
            X /= *it; 
            result.push_back(*it);
        }
    }
    if (X != 1) result.push_back(X); //The last factor above sqrt(X)
    return result;
}

long long qmult(long long X, long long Y, long long M) {
    if (Y == 0) return 0; 
    long long half = qmult(X, Y/2, M);
    half += half;
    half %= M;
    if (Y % 2==1) half += X;
    return half%=M;
}
long long qexp(long long A, long long B, long long M) {
    if (B == 0) return 1; 
    long long half = qexp(A, B/2, M); 
    half = qmult(half, half, M); 
    half %= M;
    if (B%2==1) half *= A%M; 
    return half%M;
}

int32_t main() {
	IAMSPEED
	// set testing to 0 when submitting to judge
	isPrime.reset();
	isPrime.flip();
	isPrime[0] = isPrime[1] = 0;
	primeList.push_back(2);
	for (int i = 4; i <= MAXN; i+=2) isPrime[i] = 0;
	for (int i = 3; i <= MAXN; i+=2) {
		if (!isPrime[i]) continue;
		primeList.push_back(i);
		for (int j = i; j <= MAXN; j+=i) isPrime[j] = 0;  
	}
	int n; cin >> n;
	FOR(i,1,n) {
		ll x; cin >> x;
		A[i] = x;
		vector <int> v = primeFactorize(x);
		unordered_map<int,int> cnt;
		for (auto it : v) {
			cnt[it]++;
		}
		for (auto it : cnt) {
			maxself(mp[it.f],it.s);
		}
	}
	ll lcm = 1;
	for (auto i : mp) {
		lcm*=qexp(i.f,i.s,MOD);
		lcm%=MOD;
	}
	db(lcm);
	ll ans = 0;
	FOR(i,1,n) {
		ll a = lcm;
		ll b = A[i];
		ans+=((a % MOD) * (qexp(b, MOD-2, MOD) % MOD)) % MOD;
		ans%=MOD;
		db(ans);
	}
	cout << ans;
}



Measured memory_bytes: 768