#include <bits/stdc++.h>
using namespace std;
using Int = int_fast64_t;

template<Int Mod = 1000000007> class modint{
public:
	Int val;
	constexpr modint(const Int x = 0) : val(x % Mod) {if(val < 0) val += Mod;}
	constexpr modint operator+(const modint rhs) const {
		return modint(*this) += rhs;
	}
	constexpr modint operator-(const modint rhs) const {
		return modint(*this) -= rhs;
	}
	constexpr modint operator*(const modint rhs) const {
		return modint(*this) *= rhs;
	}
	constexpr modint operator/(const modint rhs) const {
		return modint(*this) /= rhs;
	}
	constexpr modint operator-() const {
		return modint(Mod - val);
	}
	constexpr modint &operator+=(const modint rhs){
		val += rhs.val;
		if(val >= Mod) val -= Mod;
		return *this;
	}
	constexpr modint &operator-=(const modint rhs){
		if(val < rhs.val) val += Mod;
		val -= rhs.val;
		return *this;
	}
	constexpr modint &operator*=(const modint rhs){
		val *= rhs.val;
		val %= Mod;
		return *this;
	}
	constexpr modint &operator/=(const modint rhs){
		return *this *= inv(rhs);
	}
	constexpr modint &operator++(){
		++val;
		if(val == Mod) val = 0;
		return *this;
	}
	constexpr modint &operator--(){
		--val;
		if(val == -1) val = Mod - 1;
		return *this;
	}
	constexpr modint operator<<(const Int rhs) const {
		return modint(*this) << rhs;
	}
	constexpr modint operator>>(const Int rhs) const {
		return modint(*this) >> rhs;
	}
	constexpr modint &operator<<=(const Int rhs){
		val <<= rhs;
		val %= Mod;
		return *this;
	}
	constexpr modint &operator>>=(const Int rhs){
		val >>= rhs;
		val %= Mod;
		return *this;
	}
	constexpr bool operator==(const modint rhs) const {
		return val == rhs.val;
	}
	constexpr bool operator!=(const modint rhs) const {
		return val != rhs.val;
	}
	constexpr bool operator<(const modint rhs) const {
		return val < rhs.val;
	}
	constexpr bool operator>(const modint rhs) const {
		return val > rhs.val;
	}
	constexpr bool operator<=(const modint rhs) const {
		return val <= rhs.val;
	}
	constexpr bool operator>=(const modint rhs) const {
		return val >= rhs.val;
	}
	friend ostream& operator<<(ostream& os, const modint<Mod>& m){
		return os << m.val;
	}
	friend istream& operator>>(istream& is, modint<Mod>& m){
		return is >> m.val;
	}
	static constexpr modint inv(modint m){
		Int a = m.val, b = Mod, u = 1, v = 0;
		while(b){
			Int t = a / b;
			a -= t * b;
			swap(a, b);
			u -= t * v;
			swap(u, v);
		}
		u %= Mod;
		if(u < 0) u += Mod;
		return modint(u);
	}
	constexpr operator Int() const {
		return val;
	}
};
using mint = modint<>;
vector<Int> p;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	for(Int i=2; i<=1000; ++i){
		bool f = true;
		for(auto j:p)
			if(j % i == 0){
				f = false;
				break;
			}
		if(f) p.push_back(i);
	}
	Int n; cin >> n;
	vector<Int> a(n);
	for(auto &i:a) cin >> i;
	vector<Int> l(p.size());
	set<Int> st;
	for(auto i:a){
		Int u = i;
		vector<Int> t(p.size());
		for(size_t j=0; j<p.size(); ++j){
			while(u % p[j] == 0){
				++t[j];
				u /= p[j];
			}
		}
		st.insert(u);
		for(size_t j=0; j<p.size(); ++j)
			l[j] = max(l[j], t[j]);
	}
	mint m = 1;
	for(size_t i=0; i<l.size(); ++i)
		for(Int j=0; j<l[i]; ++j)
			m *= mint(p[i]);
	for(auto ite=st.begin(); ite!=st.end(); ++ite)
		m *= mint(*ite);
	mint ans = 0;
	for(Int i=0; i<n; ++i)
		ans += m / mint(a[i]);
	cout << ans << "\n";
}

Measured memory_bytes: 896