using namespace std;

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

#define getBit(x,i) (x&(1<<i))
#define setBit(x,i) (x|(1<<i))
#define mem(A,N) memset(A,N,sizeof(A))
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mp make_pair
#define rep(i, x, y)  for(int i = x; i < y; ++i)
#define Rep(i, x, y)  for(int i = x; i <= y; ++i)
#define srep(i, x, y) for(int i = x; i > y; --i)
#define sRep(i, x, y) for(int i = x; i >= y; --i)
#define All(v) v.begin(),v.end()
#define sortA(a) sort(a, a+n)
#define sortArr(a, i, n) sort(a+i, a+n)
#define SortArr(a, i, n) sort(a+i, a+n+1)
#define Sort(x) sort(x.begin(), x.end())
#define f1(i,n) for (int i=1; i<=n; i++)
#define f0(i,n) for (int i=0; i<n; i++)
#define sz(x) ((int)(x).size())
#define len(x) ((int)(x).length())
#define fi first
#define se second
#define concatenate(a, b) std::copy(b.begin(), b.end(), std::back_inserter(a));
#define fcout(x) cout << fixed << setprecision(x)
#define ifcout(x, a, b) if(x) cout << a << '\n'; else cout << b << '\n'
#define concatenateNoteIamNotUsingThisOne1(a, b) a.insert(b.end(), b.begin(), b.end());
#define concatenateNoteIamNotUsingThisOne2(a, b) std::move(b.begin(), b.end(), std::back_inserter(a)); // "Undefined behaviour if a actually is b (which is OK if you know that can never happen - but worth being aware of in general purpose code)"
#define makeUnique(v) v.erase(unique(v.begin(), v.end()), v.end())
#define inRange(x, a, b) (a <= x && x < b)

#define linf 2'000'000'000'000'000'001LL
#define inf 1'000'000'001
#define ninf -1'000'000'001
#define mod 1'000'000'007
#define eps 1e-9
#define Pi 3.14159265358979323846

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define write(x) cerr << #x << " = " << (x) << ", ";
#define writeI0 cerr << "i = " << 0 << ", ";
#define dumpI0 cerr << "i = " << 0 << endl;
#define printSet(s) for(auto it = s.begin(); it!=s.end(); it++) (it==s.begin())? cout << *it : cout << ' ' << *it; cout << endl;
#define printMap(m) for(auto it = m.begin(); it!=m.end(); it++) (it==m.begin())? cout << '(' << it->first << ", " << it->second << ')' : cout << " (" << it->first << ", " << it->second << ')'; cout << endl;
#define printPairSet(s) for(auto it = s.begin(); it!=s.end(); it++) (it==s.begin())? cout << '(' << it->first << ", " << it->second << ')' : cout << " (" << it->first << ", " << it->second << ')'; cout << endl;
#define printVector(x) for(auto it = x.begin(); it!=x.end(); it++) (it==x.begin())? cout << *it : cout << ' ' << *it; cout << endl;
#define printArray(a,x,y) for(auto it = a+x; it != a+y; it++) (it==a+x)? cout << *it : cout << ' ' << *it; cout << endl;
#define PrintArray(a,x,y) for(auto it = a+x; it != a+y+1; it++) (it==a+x)? cout << *it : cout << ' ' << *it; cout << endl;

// ***************** End Of Template ********************

int modPow(int b, int e) {
    int r = 1;
    while(e > 0) {
        if(e & 1) {
            r = (long long) r * b % mod;
        }
        b = (long long) b * b % mod;
        e /= 2;
    }
    return r;
}

int modInverse(int a) {
    return modPow(a, mod - 2);
}

vector<int> primes;
bitset<1000004> isPrime;
int minDivI[1000004];
int maxPf[1000001];

void sieve() {
	isPrime.set();
	isPrime[0] = isPrime[1] = 0;

	for(int j = 4; j <= 1000002; j += 2) {
		isPrime[j] = 0;
	}
	
	for(int j = 3; j <= 1000003; j += 2)
		minDivI[j] = 1000004;

    primes.push_back(2);
    int currentNofPrimes = 1;
	for(int i = 3; i <= 1000; i += 2)
		if(isPrime[i]) {
            primes.push_back(i);
            minDivI[i] = currentNofPrimes;
			for(int j = i * i; j <= 1000003; j += i) {
				isPrime[j] = 0;
                minDivI[j] = min(minDivI[j], currentNofPrimes);
			}
            ++currentNofPrimes;
        }

	for(int i = 1009; i <= 1000003; i += 2) {
		if(isPrime[i]) {
            primes.push_back(i);
            minDivI[i] = currentNofPrimes++;
        }
    }
    minDivI[1] = currentNofPrimes - 1;
}

void factor(int a) {
	int i = minDivI[a], prime = primes[i], t = 0;
	while(a != 1 && (ll) prime * prime <= a) {
		while(a % prime == 0) {
			a /= prime;
			t++;
    	}
        if (t) {
            maxPf[prime] = max(maxPf[prime], t);
            t = 0;
        }
    	prime = primes[++i];
	}
	if(a != 1) {
        maxPf[a] = max(maxPf[a], 1);
	}
}

int main() {
    sieve();
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int n, t, ans = 0, mx = ninf; ; cin >> n;

    rep(i, 0, n) {
        cin >> t;
        mx = max(mx, t);
        factor(t);
        ans = (ans + modInverse(t)) % mod;
    }
    
    if (maxPf[2]) 
        ans = (ll) ans * modPow(2, maxPf[2]) % mod;
    for(int i = 3; i <= mx; i+= 2) {
        if (maxPf[i]) {
            ans = (ll) ans * modPow(i, maxPf[i]) % mod;
        }
    }

    cout << ans;
	return 0;
}

Measured memory_bytes: 8312