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

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))
#define debug(a) cerr << #a << " = " << a << endl;

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}

const double PI = acos(-1.0);
const LL INF = 1e9 + 47;
const LL LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

namespace Modular
{
	const int mod = 1e9 + 7;

	template <typename T>
	T inverse(T a, T m) {
	  T u = 0, v = 1;
	  while (a != 0) {
		T t = m / a;
		m -= t * a; swap(a, m);
		u -= t * v; swap(u, v);
	  }
	  assert(m == 1);
	  return u;
	}

	class Mint
	{
	public:
		int value;
		
		Mint(){value = 0;};	
		Mint(int _n)
		{
			value = _n;
			if (value >= 0 && value < mod) return;
			value %= mod;
			if (value < 0) value += mod;
		}
		
		Mint& operator++(){ return *this += 1; }
		Mint& operator--(){ return *this -= 1; }
		Mint operator-() const { return Mint(-value); }
		
		Mint& operator+=(const Mint& other) 
		{
			if ((value += other.value) >= mod) value -= mod;
			return *this; 
		}
		
		Mint& operator-=(const Mint& other) 
		{
			if ((value -= other.value) < mod) value += mod;
			return *this; 
		}	
		
		Mint& operator*=(const Mint& other) 
		{
			value = (value * (LL) other.value) % mod;
			return *this; 
		}		
		
		Mint& operator/=(const Mint& other) 
		{
			return *this *= Mint(inverse(other.value, mod)); 
		}
		
		bool operator==(const Mint& other)
		{
			return value == other.value;
		}
		
		bool operator<(const Mint& other)
		{
			return value < other.value;
		}

		bool operator>(const Mint& other)
		{
			return value > other.value;
		}

		friend std::istream& operator>>(std::istream& stream, Mint& number)
		{
			int x;
			stream >> x;
			number = Mint(x);
			return stream;
		}
		
		friend std::ostream& operator<<(std::ostream& stream, Mint number)
		{
			stream << number.value;
			return stream;
		}		
	};

	Mint operator+(const Mint& l, const Mint& r)
	{
		return Mint(l) += r;
	}
	
	Mint operator-(const Mint& l, const Mint& r)
	{
		return Mint(l) -= r;
	}
	
	Mint operator*(const Mint& l, const Mint& r)
	{
		return Mint(l) *= r;
	}
	
	Mint operator/(const Mint& l, const Mint& r)
	{
		return Mint(l) /= r;
	}
	
	template<typename T, typename S>
	Mint power(T& a, S y)
	{
		Mint res = 1;
		Mint x = a;
		while(y)
		{
			if(y & 1) res *= x;
			x *= x;
			y >>= 1;
		}
		
		return res;
	}
};

using namespace Modular;

const int N = 1 << 20;
int p[N];
int a[N];
int cnt[N];
map<int, int> C[N];

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	
	iota(p + 2, p + N, 2);
	FOR(i, 2, N) if (p[i] == i)
		for(int j = i + i; j < N; j += i) if (p[j] == j)
			p[j] = i;
			
	int n;
	cin >> n;
	FOR(i, 0, n) cin >> a[i];
	
	FOR(i, 0, n)
	{
		int x = a[i];
		int P = p[x];
		while(x > 1)
		{
			while(x % P == 0) x /= P, C[i][P]++;
			setmax(cnt[P], C[i][P]);
			P = p[x];
		}
	}
	
	Mint all = 1;
	FOR(i, 0, N) FOR(j, 0, cnt[i]) all *= i;
	
	debug(all)
	Mint ans = 0;
	FOR(i, 0, n)
		ans += all / a[i];
	
	cout << ans << endl;
	
	cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
	return 0;
}



Measured memory_bytes: 61056