#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 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> 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);
	}
};

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

using mod = modcalc<1000000007U>;



int main()
{
	// ABC152E

	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;
		mod::muleq(lcmmod, mod::pow(prime, exponent));
	}

	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