#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF = 1e9;
const int MOD = 1000000007;
#define rep(i,n) for(int i=0;i<n;i++)

template<int MOD> struct Fp {
        long long val;
        constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
                if( val < 0) val +=  MOD;
        }
        constexpr int getmod() { return MOD;}
        constexpr Fp operator - () const noexcept {
                return val ? MOD - val :0;
        }
        constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r;}
        constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
        constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
        constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
        constexpr Fp& operator += (const Fp& r) noexcept {
                val += r.val;
                if (val >= MOD) val -= MOD;
                return *this;
        }
        constexpr Fp& operator -= (const Fp& r) noexcept {
                val -= r.val;
                if (val < 0) val += MOD;
                return *this;
        }
        constexpr Fp& operator *= (const Fp& r) noexcept {
                val = val * r.val % MOD;
                return *this;
        }
        constexpr Fp& operator /= (const Fp& r) noexcept {
                long long a = r.val, b = MOD, u = 1, v = 0;
                while (b) {
                        long long t = a / b;
                        a -= t * b; swap(a, b);
                        u -= t * v; swap(u, v);
                }
                val = val * u % MOD;
                if (val < 0) val += MOD;
                return *this;
        }
        constexpr bool operator == (const Fp& r) const noexcept {
                return this->val == r.val;
        }
        constexpr bool operator != (const Fp& r) const noexcept {
                return this->val != r.val;
        }
        friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
                return os << x.val;
        }
        friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
                if (n == 0) return 1;
                auto t = modpow(a, n / 2);
                t = t * t;
                if (n & 1) t = t * a;
                return t;
        }
};

using mint = Fp<MOD>;

struct Sieve {
        int n;
        vector<int> f,primes;
        
        Sieve(int n=1):n(n),f(n+1){
                f[0] = f[1] = -1;
                for(long long i=2;i<=n;++i){
                        if(f[i]) continue;
                        primes.push_back(i);
                        f[i] = i;
                        for(long long j = i*i;j <= n;j += i) {
                                if(!f[j]) f[j] = i;
                        }
                }
        }
        
        bool ifPrime(int x){return f[x] == x;}
        
        vector<int> factorList(int x){
                vector<int> res;
                while(x != 1){
                        res.push_back(f[x]);
                        x /= f[x];
                }
                return res;
        }
        
        vector<pair<int,int>> factor(int x){
                vector<int> fl = factorList(x);
                if(fl.size() == 0) return {};
                vector<pair<int,int>> res(1,pair<int,int>(fl[0],0));
                for(int p:fl){
                        if(res.back().first == p){
                                res.back().second ++;
                        }else{
                                res.emplace_back(p,1);
                        }
                }
                return res;
        }
        
};

 
int main() {
  Sieve sieve(1000005);
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a.at(i);
  map<int,int> mp;
  rep(i,n){
    auto f = sieve.factor(a[i]);
    for(auto p:f){
      mp[p.first] = max(mp[p.first],p.second);
    }
  }
  
  mint lcm = 1;
  for(auto p:mp){
    rep(i,p.second){
      lcm *= p.first;
    }
  }
  
  mint ans = 0;
  rep(i,n){
    mint b = lcm/a[i];
    ans += b;
  }
  
  cout << ans << endl;
}
  

Measured memory_bytes: 4984