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

typedef long long ll;
typedef pair<int,int> pii;


const ll MOD = 1e9+7;
const ll mod = 1e9+7;
template< int mod >
struct ModInt {
  int x;
  ModInt() : x(0) {}
  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
  ModInt &operator+=(const ModInt &p) {
    if((x += p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator-=(const ModInt &p) {
    if((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator*=(const ModInt &p) {
    x = (int) (1LL * x * p.x % mod);
      return *this;
  }
  ModInt &operator/=(const ModInt &p) {
    *this *= p.inv();
    return *this;
  }
  ModInt operator-() const { return ModInt(-x); }
  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
  bool operator==(const ModInt &p) const { return x == p.x; }
  bool operator!=(const ModInt &p) const { return x != p.x; }
    
  ModInt inv() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }
  
  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while(n > 0) {
      if(n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }
  
  friend ostream &operator<<(ostream &os, const ModInt &p) {
    return os << p.x;
  }
  
  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt< mod >(t);
    return (is);
  }
  
  static int get_mod() { return mod; }
};
 
using mint = ModInt<mod>;

// mod. m での a の逆元 a^{-1} を計算する
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}



// 素因数分解
template<typename T>
map<T, ll> prime_factorize(T x){
  map<T, ll> res;

  while(x%2==0){
    x/=2;
    res[2]++;
  }

  for(ll i=3;i*i<=x;i+=2){
    while(x%i==0){
      x/=i;
      res[i]++;
    }
  }
  if(x!=1) res[x]++;
  return res;
}

int main(){
  cout << setprecision(10);
  int N;
  cin >> N;
  vector<mint> X;

  map<ll,ll> prime;
  int num_1 = 0;

  for(int i = 0; i < N; i++){
    ll A;
    cin >> A;

    // 1なら無視する
    if(A == 1){
      num_1++;
      continue;
    }
    // 1じゃないなら確保しておく
    mint tmp = A;
    X.push_back(tmp);

    auto tmp_prime = prime_factorize(A);
    for(auto x: tmp_prime){
      if(prime.count(x.first) == 0){
        prime[x.first] = x.second;
      } else {
        prime[x.first] = (x.second > prime[x.first] ? x.second : prime[x.first]);
      }
    }
  }

  // 全部1ならやめる
  if(num_1 == N){
    cout << N << endl;
    return 0;
  } else {
    N = N - num_1;
  }

  // 最小公倍数を計算する 
  mint lcm_val = 1;
  for(auto x:prime ){
    mint first = x.first;
    ll second = x.second;
    lcm_val = lcm_val * first.pow(second);
  }

  mint ans = 0;
  for(int i = 0; i < N; i++){
    mint tmp = X.at(i);
    mint B = lcm_val * tmp.inv();
    ans += B;
  }
  cout << ans << endl;

}


Measured memory_bytes: 896