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

#define fi                      first
#define se                      second
#define pb                      push_back
#define endl                    '\n'
#define all(x)                  x.begin(),x.end()
#define pii                     pair<int,int>
#define pll                     pair< long long int, long long int> 
#define fast                    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define SZ(x)                   ((int)x.size())

#define FOR(i,a,b)              for(int i = a; i < b; ++i)
#define REV(i,a,b)              for(int i = a; i >= b; --i)
#define FORE(i,a,b)             for(int i = a; i <= b; ++i)

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

template <typename A, typename B>
string to_string(pair<A, B> p);
 
string to_string(const string& s) {
        return '"' + s + '"';
}
 
string to_string(const char* s) {
        return to_string((string) s);
}
 
string to_string(bool b) {
        return (b ? "true" : "false");
}
 
string to_string(vector<bool> v) {
        bool first = true;
        string res = "{";
        for (int i = 0; i < static_cast<int>(v.size()); i++) {
                if (!first) {
                        res += ", ";
                }
                first = false;
                res += to_string(v[i]); 
        }
        res += "}";
        return res;
}
 
template <size_t N>
string to_string(bitset<N> v) {
        string res = "";
        for (size_t i = 0; i < N; i++) {
                res += static_cast<char>('0' + v[i]);
        }
        return res;
}
 
template <typename A>
string to_string(A v) {
        bool first = true;
        string res = "{";
        for (const auto &x : v) {
                if (!first) {
                        res += ", ";
                }
                first = false;
                res += to_string(x);
        }
        res += "}";
        return res;
}
 
template <typename A, typename B>
string to_string(pair<A, B> p) {
        return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
 
void debug_out() { 
        cerr << endl; 
}
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
        cerr << " " << to_string(H);
        debug_out(T...);
}
 
#ifdef IGM
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void solve();

int32_t main()
{
        fast;
        int t = 1;
        // cin >> t;
        for(int i = 1; i <= t; ++i)
                solve();
        cerr << "Time taken: " << ((clock() * 1000) / CLOCKS_PER_SEC) << "ms\n";
}

ll pow(ll a,ll b, ll m) {
        ll ans=1; 
        while(b>0){ 
                if(b%2==1) 
                        ans=(ans*a)%m; 
                b/=2; 
                a=(a*a)%m; 
        } 
        return ans%m; 
}
ll InverseMod(ll a,ll m) {
        return pow(a,m-2,m);
}
 
ll add(ll a,ll b,ll mod) {
        ll c = (a + b);
        if(c >= mod) {
                c -= mod;
        }
        return c;
}
ll sub(ll a,ll b,ll mod) {
        ll c = (a - b);
        if(c < 0) {
                c += mod;
        }
        return c;
}
ll mul(ll a,ll b,ll mod) {
        ll c = (a*b)%mod;
        return c;
}
ll div(ll a,ll b,ll mod) {
        ll c = mul(a,InverseMod(b,mod),mod);
        return c;
}

#define int long long int



void solve() {
        int n;
        const ll mod = 1e9  + 7;
        cin >> n;
        std::vector<int> v(n);
        FOR(i,0,n) {
        	cin >> v[i];
        }
        int temp = v[0];
        FOR(i,1,n) {
        	temp = __gcd(temp,v[i]);
        }
  	map<int,int> lcm;
        ll cur = 1;
        FOR(i,0,n) {
        	v[i] /= temp;
        	int kk = v[i];
        	map<int,int> mp;
        	for(int j = 2; j*j <= kk; ++j) {
        		while(kk%j == 0) {
        			kk /= j;
        			mp[j]++;
        		}
        	}
        	if(kk > 1) {
        		mp[kk]++;
        	}
        	for(auto j:mp) {
        		lcm[j.fi] = max(lcm[j.fi], j.se);
        	}
        }
        for(auto i:lcm) {
        	FOR(j,0,i.se) {
        		cur = (cur * i.fi)% mod;
        	}
        }

        ll out = 0;
        FOR(i,0,n) {
        	ll kk = div(cur,v[i],mod);
        	out = (out  + kk) % mod;
        }
        cout << out << endl;
}

Measured memory_bytes: 1024