#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define mem(x, val) memset(x, val, sizeof(x))
#define mk make_pair
#define MAX 1000005
#define f(i,n) for(i = 0; i < n; i++)
#define f1(i,n) for(i = 1; i <= n; i++)
#define all(a) a.begin(),a.end()
#define upp(v,val) upper_bound(v.begin(), v.end(), val)
#define lower(v,val) lower_bound(v.begin(), v.end(), val)
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define dbg(x) cout << #x << " = " << x << endl
#define dbg2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define dbg3(x,y,z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl
#define dbg4(x,y,z,q) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << ", " << #q << " = " << q << endl
#define jaldi_chal() ios_base::sync_with_stdio(false); cin.tie(NULL);
#define S second
#define F first
#define fm(it,m) for(it = m.begin(); it != m.end(); it++)
#define ct_set(n) __builtin_popcount(n) // count no of set bits
#define INF 0x3f3f3f3f
#define endl '\n'
#define mod 1000000007
#define PI 3.14159265    // acosl(-1)
#define precision cout << setprecision(15)
#define prll_arr(a,n) for(ll i = 0; i < n; i++) cout << a[i] << " ";
#define prll_vec(v) for(ll i = 0; i < v.size(); i++) cout << v[i] << " ";
//vec.erase(std::remove(vec.begin(), vec.end(), val), vec.end());
using namespace std;

// v.resize(unique(v.begin(), v.end()) - v.begin());   // for unique elements in sorted vector
// fflush(stdout);  // after every output

// Using 128 bit llegers
/*
	std::string toString(__ll128 num) {
    std::string str;
    do {
        ll digit = num % 10;
        str = std::to_string(digit) + str;
	        num = (num - digit) / 10;
	    } while (num != 0);
	    return str;
	}
	
	ll main() {
	    __ll128_t x;
	    string s;
	    cin >> s;
	    x = (stoll)(s);
	    __ll128_t ans = x * x * x;
	    cout << toString(ans);
	}

*/

ll prime[MAX]; 
map<ll, ll> max_map; 
  
// Function to return a^n 
ll power(ll a, ll n) 
{ 
    if (n == 0) 
        return 1; 
    ll p = power(a, n / 2) % mod; 
    p = (p * p) % mod; 
    if (n & 1) 
        p = (p * a) % mod; 
    return p; 
} 
  
// Function to find the smallest prime factors 
// of numbers upto MAX 
void sieve() 
{ 
    prime[0] = prime[1] = 1; 
    for (ll i = 2; i < MAX; i++) { 
        if (prime[i] == 0) { 
            for (ll j = i * 2; j < MAX; j += i) { 
                if (prime[j] == 0) { 
                    prime[j] = i; 
                } 
            } 
            prime[i] = i; 
        } 
    } 
} 
map<ll, ll> :: iterator it; 
// Function to return the LCM modulo M 
ll lcmModuloM(ll ar[], ll n) 
{ 
  
    for (ll i = 0; i < n; i++) { 
        ll num = ar[i]; 
        map<ll, ll> temp; 
  		
        // Temp stores mapping of prime factor to 
        // its power for the current element 
        while (num > 1) { 
  
            // Factor is the smallest prime factor of num 
            ll factor = prime[num]; 
  
            // Increase count of factor in temp 
            temp[factor]++; 
  
            // Reduce num by its prime factor 
            num /= factor; 
        } 
  
        for (it = temp.begin(); it != temp.end(); it++) { 
  
            // Store the highest power of every prime 
            // found till now in a new map max_map 
            max_map[it -> first] = max(max_map[it -> first], it -> second); 
        } 
    } 
  
    ll ans = 1; 
  
    for (it = max_map.begin(); it != max_map.end(); it++) { 
  
        // LCM is product of primes to their highest powers modulo M 
        ans = (ans * power(it -> F, it -> S)) % mod; 
    } 
  
    return ans; 
} 

ll gcdExtended(ll a, ll b, ll *x, ll *y);   
ll modInverse(ll b, ll m) 
{ 
    ll x, y; 
    ll g = gcdExtended(b, m, &x, &y); 
    if (g != 1) 
        return -1; 
    return (x % m + m) % m; 
} 
  
// Function to compute a/b under modlo m 
ll modDivide(ll a, ll b, ll m) 
{ 
    a = a % m; 
    ll inv = modInverse(b, m); 
    //if (inv == -1) 
       //cout << "Division not defined"; 
    //else
       //cout << "Result of division is " << (inv * a) % m; 
       return (inv * a) % m;
} 
ll gcdExtended(ll a, ll b, ll *x, ll *y) 
{ 
    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    } 
    ll x1, y1; 
    ll gcd = gcdExtended(b % a, a, &x1, &y1); 
    *x = y1 - (b / a) * x1; 
    *y = x1; 
    return gcd; 
} 
// To call for modulo division (a / b) % m : modDivide(a, b, m);

void solve()
{
	
	ll n;
	cin >> n;
	
	ll a[n], i, j;
	
	for(i = 0; i < n; i++) { 
		cin >> a[i];
	}
	    sieve(); 
	ll lcm = lcmModuloM(a, n);
	ll ans = 0;
	for(i = 0; i < n; i++) {
		ans = (ans + modDivide(lcm, a[i], mod)) % mod;
	}
	cout << ans;
	
}

int main()
{
	jaldi_chal()
	
//	freopen("input.txt", "r" , stdin);
//  freopen("output.txt", "w", stdout);
	
//	seive();
//	for(ll i = 2; i <= 10000; i++)	{
//		if(prime[i])
//		primes.pb(i);
//	}
	
	bool codechef = 0;
	ll t = 1;
	
	if(codechef) {
		cin >> t;
	}
	
	while(t--) {
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 8832