#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>

using namespace std;

using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int,int>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vpii=vector<pii>;

#define PI 3.1415926535897932384626433832795

using ll=long long;

class mod_ll
{
public:
	ll m_v;
	static const ll m_m=1000000007; // prime value ex. 1000000009
	mod_ll(ll v=0) : m_v(v) {}
	mod_ll operator = (ll rhs)
	{
		m_v=rhs%m_m;
		return *this;
	}
	ll operator ()(){return m_v;}
	mod_ll operator = (mod_ll rhs)
	{
		m_v=rhs.m_v;
		return *this;
	}
	mod_ll operator += (ll rhs)
	{
		m_v=(m_v+rhs)%m_m;
		return *this;
	}
	mod_ll operator += (mod_ll rhs)
	{
		m_v=(m_v+rhs.m_v)%m_m;
		return *this;
	}
	mod_ll operator + (mod_ll rhs)
	{
		auto ret=*this;
		return ret+=rhs;
	}
	mod_ll operator *= (ll rhs)
	{
		m_v=(m_v*rhs)%m_m;
		return *this;
	}
	mod_ll operator *= (mod_ll rhs)
	{
		m_v=(m_v*rhs.m_v)%m_m;
		return *this;
	}
	mod_ll operator * (mod_ll rhs)
	{
		mod_ll ret=*this;
		return ret*=rhs;
	}
	mod_ll operator ^ (ll rhs)
	{
		mod_ll t=*this;
		mod_ll ret(1LL);

		for(;rhs>0;rhs>>=1)
		{
			if(rhs&1) ret*=t;
			t*=t;
		}
		return ret;
	}
	mod_ll operator /= (mod_ll rhs)
	{
		return *this*=(rhs^(m_m-2));
	}
	mod_ll operator /= (ll rhs)
	{
		mod_ll t(rhs);
		return *this/=t;
	}
	mod_ll operator / (mod_ll rhs)
	{
		mod_ll ret=*this;
		return ret/=rhs;
	}
};


mod_ll mod_fact(int n)
{
	static vector<mod_ll> memo(1);

	if(memo.size()<=n)
	{
		if(memo.size()==1)
		{
			memo[0]=1;
		}
		for(int i=memo.size();i<=n;i++)
		{
			memo.push_back(memo.back()*i);
		}
	}
	return memo[n];
}


mod_ll mod_nCr(int n, int r)
{
	mod_ll bunsi=mod_fact(n);
	mod_ll bunbo=mod_fact(n-r)*mod_fact(r);
	return bunsi/bunbo;
}


mod_ll mod_nPr(int n, int r)
{
	mod_ll ret(1);

	for(int i=0;i<r;i++)
	{
		ret*=(n-i);
	}
	return ret;
}


int gcd(int a, int b)
{
	int c;
	while((c=a%b))
	{
		a=b;
		b=c;
	}
	return b;
}


bool is_prime(ll v)
{
	if(v<2) return false;
	if(v%2==0)
	{
		return (v==2);
	}

	for(ll i=3;i*i<=v;i+=2)
	{
		if(v%i==0) return false;
	}
	return true;
}

using pf=vector<pair<ll,int> >;
pf prime_factorization(ll v)
{
	pf p;

	for(ll i=2;i*i<=v;i++)
	{
		if(v%i==0)
		{
			p.push_back(make_pair(i, 1));
			for(v/=i;v%i==0;v/=i)
			{
				p.back().second++;
			}
		}
	}
	if(v>1) p.push_back(make_pair(v, 1));

	return p;
}


void calc_divisor_i(vll&r, vector<pair<ll,int> >&p, int x, ll c)
{
	if(x>=(int)p.size())
	{
		r.push_back(c);
		return;
	}
	for(int i=p[x].second;i>=0;i--)
	{
		calc_divisor_i(r, p, x+1, c);
		c*=p[x].first;
	}
}


int calc_divisor(vll&ret, ll v)
{
	auto p=prime_factorization(v);

	ret.clear();
	calc_divisor_i(ret, p, 0, 1LL);
	sort(ret.begin(), ret.end());

	return ret.size();
}


void max_u(int&m, int v)
{
	if(m<v) m=v;
}


int main(void)
{
	int n;

	while(scanf("%d", &n)==1)
	{
		vi a(n);
		for(auto&m:a) scanf("%d", &m);

		int d=a[0];
		for(auto&m:a) d=gcd(d, m);
		for(auto&m:a) m/=d;

		vi c(1000000+2);
		for(auto&m:a)
		{
			auto pf=prime_factorization(m);
			for(auto&mpf:pf)
			{
				max_u(c[mpf.first], mpf.second);
			}
		}
		mod_ll t(1);
		for(int i=2;i<(int)c.size();i++)
		{
			if(c[i]==0) continue;
			ll x=1;
			for(int j=c[i];j>0;j--) x*=i;
			t*=x;
		}
if(0)
{
		for(int i=2;i<(int)c.size();i++)
		{
			if(c[i]==0) continue;
			printf("%d^%d * ", i, c[i]);
		}
		printf("\n");
		printf("t=%lld\n", t());
		printf("d=%d\n", d);
}

		mod_ll ans(0);
		for(int i=0;i<n;i++)
		{
			ans+=(t/a[i]);
		}
		printf("%lld\n", ans());
	}
	return 0;
}


Measured memory_bytes: 4224