// Slower C++ solution:
#include <cstdio>

#include <algorithm>

#include <cstring>

#include <set>

#include <map>

#include <iostream>

#include <cstring>

#include <cmath>

#include <queue>

#define ull unsigned long long

#define ll long long

#define INF 0x3f3f3f3f

using namespace std;

void close(){

       std::ios::sync_with_stdio(false);

       std::cin.tie(0);

}

const ll mod=1e9+7;

ll qpow(ll a,ll b){

	ll ret=1;

	while(b) {

		if (b&1) ret=(ret*a)%mod;

		a=(a*a)%mod;

		b>>=1;

	}

	return ret;

}

const int maxn=1e4+5;

const int N=1e6+5;

int n,a[maxn],num[N],lcm=1,ans=0;

int main(){

	cin>>n;

	for(int i=1;i<=n;i++) cin>>a[i];

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

		int x=a[i];

		for(int j=2;j*j<=x;j++){

			if(x%j==0){

				int cnt=0;

				while(x%j==0){

					x/=j,cnt++;

				}

				num[j]=max(num[j],cnt);

			}

		}

		if(x!=1) num[x]=max(num[x],1);

	}

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

		if(num[i]){

			lcm=1ll*lcm*qpow(i,num[i])%mod;

		}

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

		ans=(ans+1ll*lcm*qpow(a[i],mod-2)%mod)%mod;

	}

	cout<<ans<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.143041615499331x):
#include <bits/stdc++.h>



#define ll long long

#define ld long double

#define ull unsigned long long

#define endl "\n"

#define MohamedMotaz ios::sync_with_stdio(0); cin.tie(0); ios_base::sync_with_stdio(0);

const ll inf = 1e18, mod = 1e9 + 7;

using namespace std;





ll fact[1000001]; ll inv[1000001];

ll primes[100007];

ll arr[1000007];

ll modPower(ll b, ll p) {

	if (p == 0)

		return 1;



	ll halfpow = modPower(b, p / 2);

	ll toReturn = (halfpow * halfpow) % mod;

	if (p % 2)

		toReturn = (toReturn * b) % mod;



	return toReturn;

}



ll fastPower(ll b, ll p) {

	if (p == 0)

		return 1;

	ll ans = fastPower(b, p / 2);

	ans = (ans * ans);

	if (p % 2 != 0)

		ans = (ans * b);

	return ans;

}

ll GcdRecursive(ll a, ll b) {

	if (b == 0) return a;

	return GcdRecursive(b, a % b);

}

ll modLCM(ll a, ll b) {

	ll val = GcdRecursive(a, b);

	ll tmp = ((a % mod) * (b % mod)) % mod;

	ll finalVal = ((tmp % mod) * (arr[val] % mod)) % mod;

	return finalVal;



}

ll LCM(ll a, ll b) {

	return (a * b) / GcdRecursive(a, b);

}

void move1step(ll& a, ll& b, ll q) { // a and b by reference

	ll c = a - q * b;

	a = b;

	b = c;

}

ll GcdIterative(ll a, ll b) {

	while (b) move1step(a, b, a / b);

	return a;

}



void pre(ll n) {



	fact[0] = 1;

	inv[0] = 1;



	for (ll i = 1; i <= n; i++) {

		fact[i] = (i * fact[i - 1]) % mod;

		inv[i] = modPower(fact[i], mod - 2);

		arr[i] = modPower(i, mod - 2);

	}

}



ll npr(ll n, ll r) {

	return ((fact[n] * inv[n - r]) % mod);

}



ll ncr(ll n, ll r) {

	return ((((fact[n] * inv[n - r]) % mod) * inv[r]) % mod);

}



void sieve(ll val) {

	memset(primes, 1, sizeof primes);

	primes[0] = primes[1] = false;

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

		if (primes[i]) {

			for (int j = i * i; j <= val; j += i) {

				primes[j] = 0;

			}

		}

	}



}



map<ll, ll> factors;



void getPrimeFactors(ll n) {

	map<ll, ll> tmp;

	while (n % 2 == 0) {

		n /= 2;

		tmp[2]++;

	}

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

		while (n % i == 0) {

			//cout << i << endl;

			n /= i;

			tmp[i]++;

		}

	}

	if (n > 2) tmp[n]++;

	for (auto elem : tmp) {

		if (factors[elem.first] < elem.second)

			factors[elem.first] = elem.second;

	}

}













int main()

{

	MohamedMotaz;

	//pre(1000001);

	ll x; cin >> x;

	vector<ll> vals;

	while (x--) {

		ll m; cin >> m; vals.push_back(m); getPrimeFactors(m);

	}

	/*for (auto elem : factors) {

		cout << elem.first << " " << elem.second << endl;

	}*/

	ll lcm = 1;

	for (auto elem : factors) {

		lcm = ((lcm % mod) * (modPower(elem.first, elem.second) % mod)) % mod;

	}

	//cout << lcm << endl;

	ll sum = 0;

	for (auto elem : vals) {

		ll val = lcm * modPower(elem, mod - 2);

		sum = sum + val;

		sum = sum % mod;

	}



	cout << sum % mod;

}