#include <bits/stdc++.h>

#define pb push_back
#define ss second
#define ff first
#define N 1000006
#define inf 1000000009
#define ll long long
#define mid(a,b) (a+b)/2
#define pii pair<int,int>

using namespace std;

const int mod = 1e9+7;
int a[N],lc[N],x,cnt,n,pr;
ll ans,jog,l;
int b[N];
vector <int> v;

ll pw(ll a,ll b){
	if(b == 0) return 1;
	ll x = pw(a,b / 2);
	if(b % 2) return (((x * x) % mod)*a)%mod;
	return (x * x) % mod;
}

int main()
{
	for(int i = 2;i <= 1e6;i++) b[i] = i;
	for(int i = 2;i*i <= 1e6;i++)
		if(b[i] == i) for(int j = i * i;j <= 1e6;j += i) if(b[j] == j) b[j] = i;
	scanf("%d",&n);
	for(int i = 1;i <= n;i++){
		scanf("%d",&a[i]);
		x = a[i],cnt = 0,pr = 0;
		while(x > 1){
			if(b[x] != pr){
				lc[pr] = max(lc[pr],cnt);
				cnt = 0;
			}
			pr = b[x];
			x /= b[x];
			cnt++;
		}
		lc[pr] = max(lc[pr],cnt);
	}
	l = 1;
	for(int i = 2;i <= 1e6;i++)
		if(lc[i]) l = (l * pw(i,lc[i])) % mod;
	for(int i = 1;i <= n;i++){
		ans = (ans + (l * pw(a[i],mod - 2)) % mod) % mod;
	}
	printf("%lld",ans);
}