#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0; i < (ll)(n); i++)
#define repi(i,a,b) for(ll i = (ll)(a); i < (ll)(b); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF = 1LL << 60;
//auto mod int

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){} //初期化指定子
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator++() {
      if ((x++) >= mod) x-= mod;
      return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator--() {
      if ((x += mod-1) >= mod) x-= mod;
      return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

const int MX = 1000005;
struct Sieve {
    int n;
    vector<int> f, primes;
    Sieve(int n=1): n(n), f(n+1){
        f[0] = f[1] = -1;
        for(ll i=2; i<=n; i++){
            if(f[i])continue;
            f[i] = i;
            primes.push_back(i);
            for(ll j=i*i; j<=n; j+=i){
                if(!f[j]) f[j]=i; //値が入っていない場合更新
            }
        }
    }
    bool isPrime(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<P> factor(int x){
        vector<int> fl = factorList(x);
        if(fl.size()==0) return {};
        vector<P> res(1,P(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(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    Sieve prime(MX);
    vector<P> af[n];
    rep(i,n) af[i] = prime.factor(a[i]);
    
    map<int,int>lcm; //
    rep(i,n){
        for(auto f : af[i]){
            lcm[f.first] = max(lcm[f.first], f.second);
        }
    }
    mint lcmn = 1;
    for(auto p: lcm){
        mint now = p.first;
        lcmn *= now.pow(p.second);
    }
    mint ans = 0;
    rep(i,n) {
        ans += lcmn / a[i];
    }
    cout << ans.x << endl;
    return 0;
}

Measured memory_bytes: 5500