#define _CRT_SECURE_NO_WARNINGS
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/stack:200000000")
#include <bits/stdc++.h>
#define SIZE 300010
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define ll long long
#define mp make_pair
#define pi acos(-1.0)
#define eps 1e-6
using namespace std;
void io() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); }
const ll mod = 1e9 + 7;
ll n, m, T, ans;
ll t[SIZE], l[SIZE], h[SIZE];
ll qpow(ll a, ll b, ll mod) { //快速幂 a ^ b % mod
	ll ans = 1;
	while (b) {
		if (b & 1) ans = (ans * a) % mod;
		a = (a * a) % mod;
		b >>= 1;
	}
	return ans;
}
struct Point {
	double x, y;
	Point() {}
	Point(double xx, double yy) :x(xx), y(yy) {}
	void input() { scanf("%lf %lf", &x, &y); }
	bool operator < (const Point& b)const {
		return x == b.x ? y < b.y : x < b.x;
	}
	void output() { printf("%.0lf %.0lf\n", x, y); }
};// p[SIZE], ch[SIZE];
typedef Point Vector;
int dcmp(double x) {	//卡精度，判断大小
	if (fabs(x) < eps) return 0;
	if (x < 0) return -1;
	return 1;
}
double cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }	//叉积
double dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }	//点积
Point operator *(Point a, double t) { return Point(a.x * t, a.y * t); }	//向量数乘
Point operator +(Point a, Point b) { return Point(a.x + b.x, a.y + b.y); }	//向量加法
Point operator -(Point a, Point b) { return Point(a.x - b.x, a.y - b.y); }	//向量减法
Point operator / (Point a, double p) { return Point(a.x / p, a.y / p); }	//向量数乘的除法形式
int andrew(Point p[], Point ch[], int n) {	//安德鲁算法求凸包，返回顶点数
	sort(p + 1, p + n + 1);
	int top = 0;
	for (int i = 1; i <= n; ++i) {
		while ((top > 1) && (cross(ch[top] - ch[top - 1], p[i] - ch[top]) <= 0)) --top;
		ch[++top] = p[i];
	}
	int tmp = top;
	for (int i = n - 1; i; --i) {
		while ((top > tmp) && (cross(ch[top] - ch[top - 1], p[i] - ch[top]) <= 0)) --top;
		ch[++top] = p[i];
	}
	if (n > 1) top--;
	return top;
}
ll xx, yy;
int A, B, C; //三角形三点的下标
double Maximum_Triangle(int n, Point p[]) { //平面最大三角形 O(n ^ 2)，n 为点数，p为点集（请保证下标为1, 2, ..., n）
	double maxa = 0;
	for (int i = 1, j = 2, k = 3; i <= n; ++i) { // i 为 root 点下标
		j = i % n + 1; k = j % n + 1;
		int id1 = i, id2 = j, id3 = k;
		bool f = false;
		double tp = fabs(cross(p[j] - p[i], p[j] - p[k])); // cross 为叉积计算三角形面积
		for (;; k = k % n + 1) {
			while (1) {
				if (k == i) { f = true; break; } // 跑完一圈跳出
				double tmp = fabs(cross(p[j] - p[i], p[j] - p[k % n + 1]));
				if (tmp > tp) tp = tmp, id3 = ++k;
				else break;
			}
			if (f) break;
			while (1) {
				double tmp = fabs(cross(p[j % n + 1] - p[i], p[j % n + 1] - p[k]));
				if (tmp > tp) tp = tmp, id2 = ++j;
				else break;
			}
		}
		if (tp > maxa) maxa = tp, A = id1, B = id2, C = id3;
	}
	return 0.5 * maxa; // 返回最大三角形面积
}

bool check() {
	int L = l[0], R = h[0];
	rep(i, 1, n) {
		t[0] = 0;
		xx = L + t[i] - t[i - 1], yy = R - t[i] + t[i - 1];
		if (yy < l[i]) yy = l[i];
		if (xx > h[i]) xx = h[i];
		L = xx, R = yy; //swap
		// cout << L << ' ' << R << '\n';
		// cout << xx << ' ' << yy << '\n';
		if (R > L) return false;
	}
	return true;
}

map<ll, ll> MP, MAP;
namespace Pollard_Rho {
	inline ll gcd(ll a, ll b) {
		return b == 0 ? a : gcd(b, a % b);
	}
	inline ll mulmod(ll x, ll y, const ll z) {
		return (x * y - (ll)(((long double)x * y + 0.5) / (long double)z) * z + z) % z;
	}
	inline ll powmod(ll a, ll b, const ll mo) {
		ll s = 1;
		for (; b; b >>= 1, a = mulmod(a, a, mo)) if (b & 1) s = mulmod(s, a, mo);
		return s;
	}
	bool isPrime(ll p) { // Miller-Rabin
		const int lena = 10, a[lena] = { 2,3,5,7,11,13,17,19,23,29 };
		if (p == 2) return true;
		if (p == 1 || !(p & 1) || (p == 46856248255981ll)) return false;
		ll D = p - 1; while (!(D & 1)) D >>= 1;
		for (int i = 0; i < lena && a[i] < p; i++) {
			ll d = D, t = powmod(a[i], d, p); if (t == 1) continue;
			for (; d != p - 1 && t != p - 1; d <<= 1) t = mulmod(t, t, p);
			if (d == p - 1) return false;
		}
		return true;
	}
	void reportFactor(ll n) { // 得到一个素因子
		MP[n]++; //cout << n << ' ';
	}
	ll ran() { return rand(); } // 随机数
	void getFactor(ll n) { // Pollard-Rho
		if (n == 1) return;
		if (isPrime(n)) { reportFactor(n); return; }
		while (true) {
			ll c = ran() % n, i = 1, x = ran() % n, y = x, k = 2;
			do {
				ll d = gcd(n + y - x, n);
				if (d != 1 && d != n) { getFactor(d); getFactor(n / d); return; }
				if (++i == k) y = x, k <<= 1;
				x = (mulmod(x, x, n) + c) % n;
			} while (y != x);
		}
	}
}
using namespace Pollard_Rho;

ll a[SIZE];
int main() {
	io(); cin >> n;
	rep(i, 1, n) cin >> a[i];
	rep(j, 1, n) {
		MP.clear();
		MP[1]++;
		getFactor(a[j]);
		for (auto i : MP) {
			if (MAP.count(i.first)) MAP[i.first] = max(MAP[i.first], i.second);
			else MAP[i.first] = i.second;
		}
		//cout << '\n';
	}
	ll LCM = 1ll;
	for (auto i : MAP) {
		LCM = (LCM * qpow(i.first, i.second, mod)) % mod;
	}
	rep(i, 1, n) ans = (ans + LCM * qpow(a[i], mod - 2ll, mod) % mod + mod) % mod;
	cout << ans;
}

Measured memory_bytes: 3072