#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define rep2(i, m, n) for(int i=(int)m; i<(int)n; i++)
#define ALL(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
const ll INF = 100100100100;

const int MOD = 1000000007;
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;
  }
};

struct Eratos {
  vector<int> primes, min_factor;
  vector<bool> isprime;
  Eratos(int MAX) : primes(),
                    isprime(MAX+1, true),
                    min_factor(MAX+1, -1) {
    isprime[0] = isprime[1] = false;
    min_factor[0] = 0, min_factor[1] = 1;
    for (int i = 2; i <= MAX; i++) {
      if (!isprime[i]) continue;
      primes.push_back(i);
      min_factor[i] = i;
      for (int j = i*2; j <= MAX; j += i) {
        isprime[j] = false;
        if (min_factor[j] == -1) min_factor[j] = i;
      }
    }
  }
  // prime factorization
  vector<pair<int,int>> factorize(int n) {
    vector<pair<int,int>> res;
    while (n != 1) {
      int prime = min_factor[n];
      int exp = 0;
      while (min_factor[n] == prime) {
        exp++;
        n /= prime;
      }
      res.push_back(make_pair(prime, exp));
    }
    return res;
  }
};
using mint = Fp<MOD>;

int main(){
  Eratos era(1e6+10);
  ll N;
  cin >> N;
  vector<int> A(N);
  rep(i, N) cin >> A[i];
  int max_a = *max_element(ALL(A));

  vector<int> max_e(max_a+1);
  rep(i, N){
    for(auto j : era.factorize(A[i])){
      max_e[j.first] = max(max_e[j.first], j.second);
    }
  }
  
  mint m = 1;
  rep(i, max_e.size()){
    m *= modpow(mint(i), max_e[i]);
  }
  
  mint ans = 0;
  rep(i, N){
    ans += m / mint(A[i]);
  }

  cout << ans << endl;
}

Measured memory_bytes: 8568