#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <cstdlib>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()
#pragma endregion

#pragma region MODint
template<int MOD> struct Fp
{
	long long val;
	constexpr Fp(long long v = 0) noexcept : val(v % MOD)
	{
		if (val < 0) val += MOD;
	}
	constexpr int getmod() { return MOD; }
	constexpr Fp operator - () const noexcept
	{
		return val ? MOD - val : 0;
	}
	constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
	constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
	constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
	constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
	constexpr Fp& operator += (const Fp& r) noexcept
	{
		val += r.val;
		if (val >= MOD) val -= MOD;
		return *this;
	}
	constexpr Fp& operator -= (const Fp& r) noexcept
	{
		val -= r.val;
		if (val < 0) val += MOD;
		return *this;
	}
	constexpr Fp& operator *= (const Fp& r) noexcept
	{
		val = val * r.val % MOD;
		return *this;
	}
	constexpr Fp& operator /= (const Fp& r) noexcept
	{
		long long a = r.val, b = MOD, u = 1, v = 0;
		while (b)
		{
			long long t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % MOD;
		if (val < 0) val += MOD;
		return *this;
	}
	constexpr bool operator == (const Fp& r) const noexcept
	{
		return this->val == r.val;
	}
	constexpr bool operator != (const Fp& r) const noexcept
	{
		return this->val != r.val;
	}
	friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept
	{
		return os << x.val;
	}
	friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept
	{
		if (n == 0) return 1;
		auto t = modpow(a, n / 2);
		t = t * t;
		if (n & 1) t = t * a;
		return t;
	}
};

const int MOD = 1000000007;
using mint = Fp<MOD>; 
#pragma endregion

int main()
{
	int n; cin >> n;
	vector<int> a(n); rep(i, n)cin >> a[i];
	vector<int> era(1e6 + 5);
	era[0] = era[1] = -1;
	for (int i = 2; i <= 1e6; ++i)
	{
		if (!era[i])
		{
			for (int j = i + i; j <= 1e6; j += i)
			{
				if (!era[j])era[j] = i;
			}
		}
	}
	map<int, int> mp;
	rep(i, n)
	{
		vector<pair<int, int>> factor;
		factor.emplace_back(1, 0);
		int now = a[i];
		while (era[now] > 0)
		{
			if (era[now] == factor.back().first)++factor.back().second;
			else factor.emplace_back(era[now], 1);
			now /= era[now];
		}
		if (era[now] == 0)
		{
			if(now==factor.back().first)++factor.back().second;
			else factor.emplace_back(now, 1);
		}
		for (auto p : factor)
		{
			mp[p.first] = max(mp[p.first], p.second);
		}
	}
	mint lcm = 1;
	for (auto p : mp)
	{
		rep(i, p.second)lcm *= p.first;
	}
	mint res = 0;
	rep(i, n)
	{
		mint b = a[i];
		res += lcm / a[i];
	}
	cout << res << endl;
}

Measured memory_bytes: 4608