#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;

const int INF = 1001001001;

const int mod = 1000000007;

struct mint{
  ll x;
  mint(ll x = 0):x((x % mod + mod) % mod){};
  mint pow(ll y) const {
    mint res(1);
    mint a(x);
    while(y>0){
      if(y&1) res *= a;
      a *= a;
      y >>= 1;
    }
    return res;
  }
  mint inv() const{ return pow(mod-2); }
  mint& operator+= (const mint a) noexcept {
    if((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-= (const mint a) noexcept {
    if((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*= (const mint a) noexcept {
    (x *= a.x) %= mod;
    return *this;
  }
  mint& operator/= (const mint a) noexcept {
    return (*this) *= a.inv();
  }
  mint operator+ (const mint a) const noexcept {
    mint res(*this);
    return res += a;
  }
  mint operator- (const mint a) const noexcept {
    mint res(*this);
    return res -= a;
  }
  mint operator* (const mint a) const noexcept {
    mint res(*this);
    return res *= a;
  }
  mint operator/ (const mint a) const noexcept{
    mint res(*this);
    return res /= a;
  }
};

ostream& operator<<(ostream& stream, const mint& n){
  stream << n.x;
  return stream;
};

struct comb{
  vector<mint> fact, ifact;
  comb(int n): fact(n+1), ifact(n+1){
    fact[0] = 1;
    for(int i = 1; i <= n; i++) fact[i] = fact[i-1] * i;
    ifact[n] = fact[n].inv();
    for(int i = n; i >= 1; i--) ifact[i-1] = ifact[i] * i;
  }
  mint operator()(int n, int k) const noexcept{
    if(k < 0 || n < k) return 0;
    return fact[n] * ifact[k] * ifact[n-k];
  }
};

struct Sieve{
  int n;
  vector<int> f, primes;
  Sieve(int n = 1): n(n), f(n+1, 0){
    f[0] = f[1] = -1;
    for(ll i = 2; i <= n; i++){
      if(f[i]) continue;
      primes.emplace_back(i);
      f[i] = i;
      for(ll j = i*i; j <= n; j += i){
        if(!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(const int x){ return(f[x] == x); }
  vector<int> factorList(int x){
    vector<int> res;
    while(x != 1){
      res.emplace_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(pair<int, int>(p, 1));
      }
    }
    return res;
    
  }
};

int main(void){
  ll n;
  cin >> n;
  vector<ll> a(n);
  REP(i, n) cin >> a[i];
  Sieve sieve(1e6);
  map<int, int> mp;
  REP(i, n){
    auto f = sieve.factor(a[i]);
    for(auto p : f){
      chmax(mp[p.first], p.second);
    }
  }
  mint lcm = 1;
  for(auto p : mp){
    lcm *= mint(p.first).pow(p.second);
  }

  mint ans = 0;
  REP(i, n){
    ans += lcm / mint(a[i]);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 4984