#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#include <sstream>
#include <bitset>
#define ALL(x) (x).begin(), (x).end()
#define sz(a) int(a.size())
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define chu(x) cout<<"["<<#x<<" "<<(x)<<"]"<<endl
#define du3(a,b,c) scanf("%d %d %d",&(a),&(b),&(c))
#define du2(a,b) scanf("%d %d",&(a),&(b))
#define du1(a) scanf("%d",&(a));
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;}
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
ll powmod(ll a, ll b, ll MOD) { if (a == 0ll) {return 0ll;} a %= MOD; ll ans = 1; while (b) {if (b & 1) {ans = ans * a % MOD;} a = a * a % MOD; b >>= 1;} return ans;}
void Pv(const vector<int> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%d", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
void Pvl(const vector<ll> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%lld", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
inline long long readll() {long long tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') fh = -1; c = getchar();} while (c >= '0' && c <= '9') tmp = tmp * 10 + c - 48, c = getchar(); return tmp * fh;}
inline int readint() {int tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') fh = -1; c = getchar();} while (c >= '0' && c <= '9') tmp = tmp * 10 + c - 48, c = getchar(); return tmp * fh;}
const int maxn = 1000010;
const int inf = 0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
bool noprime[maxn + 50];
vector <int> p;
int getPrime()
{
	// ?????某?始??
	memset(noprime, false, sizeof(noprime));
	p.clear();

	int m = (int)sqrt(maxn + 0.5);
	// ????陌?筛
	for (int i = 2; i <= m; i++)
	{
		if (!noprime[i])
		{
			for (int j = i * i; j <= maxn; j += i)
			{
				noprime[j] = true;
			}
		}
	}
	// ?????拥?vector??
	for (int i = 2; i <= maxn; i++)
	{
		if (!noprime[i])
		{
			p.push_back(i);
		}
	}
	//????ector?拇??
	return p.size();

}
ll b[maxn];

void getPrifac( ll n, int len)
{
	for (int i = 0; 1ll * p[i]*p[i] <= n && i < len; i++)
	{
		if ( n % p[i] == 0)
		{
			ll cnt = 0;
			while (n % p[i] == 0)
			{
				cnt++;
				n /= p[i];
			}
			b[p[i]] = max(b[p[i]], cnt);
		}
	}
	if ( n > 1)
	{
		b[n] = max(b[n], 1ll);
	}
}
int n;
int a[maxn];
ll num = 1ll;
const ll mod = 1e9 + 7;
int main()
{
	//freopen("D:\\code\\text\\input.txt","r",stdin);
	//freopen("D:\\code\\text\\output.txt","w",stdout);
	int len = getPrime();
	n = readint();
	repd(i, 1, n)
	{
		a[i] = readint();
		getPrifac(a[i], len);
	}
	repd(i, 1, maxn - 1)
	{
		num = num * powmod(i, b[i], mod) % mod;
	}
	// chu(num);
	ll ans = 0ll;
	repd(i, 1, n)
	{
		ans += num * powmod(a[i], mod - 2ll, mod) % mod;
		ans %= mod;
	}
	printf("%lld\n", ans );
	return 0;
}




Measured memory_bytes: 11384