#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>
#include <limits>

/**
 * 試し割りによる素因数分解をする。
 *
 * @param x 約数を求めたい数
 * @return x の素因数と指数の unordered_map
 * @note 時間計算量は O(sqrt(x))
 */
template<typename T>
std::unordered_map<T, T> prime_factorization_trial_division(T x)
{
	std::unordered_map<T, T> result;

	if (x == 0)
		return result;

	if (x == 1)
		return result;

	T n;
	for (n = 2; n*n <= x; ++n) {
		while (x % n == 0) {
			++result[n];
			x /= n;
		}
	}

	if (x != 1)
		++result[x];

	return result;
}


// modcalc.cc からコピってきたもの
template<unsigned int MOD>
struct modcalc
{
	static_assert(MOD < std::numeric_limits<unsigned int>::max() / 4, "");

	static unsigned int add(unsigned int a, unsigned int b) __attribute__ ((warn_unused_result))
	{
		return (a + b) % MOD;
	}

	static void addeq(unsigned int& a, unsigned int b)
	{
		a = add(a, b);
	}

	static unsigned int sub(unsigned int a, unsigned int b) __attribute__ ((warn_unused_result))
	{
		return (MOD + a - b) % MOD;
	}

	static void subeq(unsigned int& a, unsigned int b)
	{
		a = sub(a, b);
	}

	static unsigned int neg(unsigned int a) __attribute__ ((warn_unused_result))
	{
		return (MOD - a) % MOD;
	}

	static void negeq(unsigned int& a)
	{
		a = neg(a);
	}

	static unsigned int mul(unsigned int a, unsigned int b) __attribute__ ((warn_unused_result))
	{
		return (static_cast<unsigned long long>(a) * static_cast<unsigned long long>(b)) % MOD;
	}

	static void muleq(unsigned int& a, unsigned int b)
	{
		a = mul(a, b);
	}

	static unsigned int pow(unsigned int a, unsigned int b) __attribute__ ((warn_unused_result))
	{
		int ret = 1;
		while (b) {
			if (b & 1)
				ret = mul(ret, a);
			a = mul(a, a);
			b >>= 1;
		}
		return ret;
	}


	// 階乗

	static std::vector<unsigned int> fac_table; // n!

	static void init_fac(unsigned int last)
	{
		fac_table.resize(last);
		fac_table[0] = 1;
		for (unsigned int i = 1; i < last; ++i) {
			fac_table[i] = mul(fac_table[i - 1], i);
		}
	}

	static unsigned int fac(unsigned int x) __attribute__ ((warn_unused_result))
	{
		return fac_table[x];
	}


	// 逆数

	static std::vector<unsigned int> inv_table; // n^-1

	static void init_inv(unsigned int last)
	{
		inv_table.resize(last);
		inv_table[0] = 0; // XXX
		inv_table[1] = 1;
		for (unsigned int i = 2; i < last; ++i) {
			inv_table[i] = MOD - mul(inv_table[MOD % i], MOD / i);
		}
	}

	static unsigned int inv(unsigned int x) __attribute__ ((warn_unused_result))
	{
		return inv_table[x];
	}

	static unsigned int div(unsigned int a, unsigned int b) __attribute__ ((warn_unused_result))
	{
		return mul(a, inv(b));
	}

	static void diveq(unsigned int a, unsigned int b)
	{
		a = div(a, b);
	}


	// 階乗の逆数

	static std::vector<unsigned int> invfac_table; // (n!)^-1

	static unsigned int init_invfac(unsigned int last)
	{
		invfac_table.resize(last);
		invfac_table[0] = 1;
		invfac_table[1] = 1;
		for (unsigned int i = 2; i < last; ++i) {
			invfac_table[i] = mul(invfac_table[i - 1], inv_table[i]);
		}
	}

	static unsigned int invfac(unsigned int x) __attribute__ ((warn_unused_result))
	{
		return invfac_table[x];
	}


	// 二項係数

	static unsigned int combination(unsigned int n, unsigned int k) __attribute__ ((warn_unused_result))
	{
		if (n < k)
			return 0;
		return mul(fac(n), mul(invfac(k), invfac(n - k)));
	}
};

template<unsigned int MOD> std::vector<unsigned int> modcalc<MOD>::fac_table;
template<unsigned int MOD> std::vector<unsigned int> modcalc<MOD>::inv_table;
template<unsigned int MOD> std::vector<unsigned int> modcalc<MOD>::invfac_table;

using mod = modcalc<1000000007U>;



int main()
{
	// ABC151E

	int N;
	std::vector<unsigned int> A;

	std::cin >> N;
	A.resize(N);
	for (auto& a : A)
		std::cin >> a;

	std::unordered_map<unsigned int, unsigned int> lcm;
	std::vector<std::unordered_map<unsigned int, unsigned int>> P;
	for (int i = 0; i < A.size(); ++i) {
		P.push_back(prime_factorization_trial_division(A[i]));
		for (auto& p : P.back()) {
			if (lcm[p.first] < p.second) {
				lcm[p.first] = p.second;
			}
		}
	}

	mod::init_inv(1000001);
	unsigned int lcmmod = 1;
	for (auto& l : lcm) {
		auto prime = l.first;
		auto exponent = l.second;
		for (int i = 0; i < exponent; ++i)
			mod::muleq(lcmmod, prime);
	}

	unsigned int Bsum = 0;
	for (int i = 0; i < A.size(); ++i) {
		mod::addeq(Bsum, mod::div(lcmmod, A[i]));
	}

	std::cout << Bsum << "\n";
}


Measured memory_bytes: 7256