#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define For(i, a, b) for (int i = int(a); i < int(b); i++)
#define Dor(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define Foz(i, a) For(i, 0, a)
#define Doz(i, a) Dor(i, 0, a)
#define Trav(e, v) for (auto& e : v)
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<ii>;
template <typename T> bool ckmin (T& a, T b) { return (b < a) ? a = b, 1 : 0; }
template <typename T> bool ckmax (T& a, T b) { return (b > a) ? a = b, 1 : 0; }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#ifdef XVENOM
	#define errp(...) fprintf(stderr, __VA_ARGS__)
	#define dbg(...) errp("[%s]: ", #__VA_ARGS__), dbg_str(__VA_ARGS__)
#else
	#define errp(...)
	#define dbg(...)
#endif
template <typename U, typename V> string to_string (pair<U, V>);
string to_string (string& e) { return "\"" + e + "\""; }
string to_string (char e) { return "\'" + string(1, e) + "\'"; }
string to_string (bool e) { return e ? "true" : "false"; }
template <typename T> string to_string (T e) {
	string s = "[ ";
	for (auto& x : e) s += to_string(x) + " ";
	return s + "]";
}
template <typename U, typename V> string to_string (pair<U, V> e) {
	return "(" + to_string(e.first) + ", " + to_string(e.second) + ")";
}
void dbg_str () { errp(" \n"); }
template <typename U, typename... V> void dbg_str (U u, V... v) {
 	errp(" %s", to_string(u).c_str()); dbg_str(v...);
}
/* --- */
ll gcdExt (ll a, ll b, ll& x, ll& y) {
	if (a == 0) { x = 0; y = 1; return b; }
	ll x1, y1; ll g = gcdExt(b % a, a, x1, y1);
	x = y1 - (b / a) * x1; y = x1; return g;
}

ll modInv (ll a, ll m) {
	ll x, y; ll g = gcdExt(a, m, x, y);
	assert(g == 1);
	return (x % m + m) % m;
}

const ll Mod = 1000000007; 
ll addMod (ll a, ll b) { ll r = a + b; return r >= Mod ? r - Mod : r; } 
ll subMod (ll a, ll b) { ll r = a - b; return r < 0 ? r + Mod : r; }
ll mulMod (ll a, ll b) { return (a * b) % Mod; }
ll divMod (ll a, ll b) { return mulMod(a, modInv(b, Mod)); }
ll addTo (ll& a, ll b) { a += b; if (a >= Mod) a -= Mod; return a; } 
ll subTo (ll& a, ll b) { a -= b; if (a < 0) a += Mod; return a; }
ll mulTo (ll& a, ll b) { return a = (a * b) % Mod; }
ll divTo (ll& a, ll b) { return mulTo(a, modInv(b, Mod)); }
ll powMod (ll a, ll b) {
	ll res = 1, x = a;
	while (b > 0) {
		if (b & 1) mulTo(res, x);
		mulTo(x, x);
		b >>= 1;
	}
	return res;
}
template <int MX> struct Sieve {
	bitset<MX + 10> isPrime;
	vector<ll> pr;
	Sieve () {
		isPrime.set(); isPrime[0] = isPrime[1] = false;
		for (int i = 4; i <= MX; i += 2) isPrime[i] = false;
		for (int i = 3; i * i <= MX; i += 2) if (isPrime[i])
			for (int j = i * i; j <= MX; j += (i << 1)) isPrime[j] = false;
		for (int i = 0; i <= MX; i++) if (isPrime[i]) pr.push_back(i);
	}
};
/* --- */
using vll = vector<ll>;
Sieve<1000000> sieve;

map<ll, ll> factorize (ll x) {
	map<ll, ll> res;
	vector<ll>& pr = sieve.pr;
	for (int i = 0; pr[i] * pr[i] <= x; i++) {
		while (x % pr[i] == 0) { x /= pr[i]; res[pr[i]]++; }
	}
	if (x != 1) res[x]++;
	return res;
}

void lcm (map<ll, ll>& p, map<ll, ll> q) {
	Trav(e, q) ckmax(p[e.first], e.second);
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	/* --- */
	ll n;
	cin >> n;
	vll a(n);
	Foz(i, n) cin >> a[i];
	map<ll, ll> freq;
	Foz(i, n) lcm(freq, factorize(a[i]));
	ll k = 1;
	Trav(e, freq) {
		ll times = e.second;
		while (times--) mulTo(k, e.first);
	}
	
	ll ans = 0;
	Foz(i, n) addTo(ans, divMod(k, a[i]));
	cout << ans << '\n';
}



Measured memory_bytes: 1780