#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <vector>

using namespace std;

typedef long long ll;

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

const ll MAX_A = 1000000LL;
const ll MOD = ll(1e9 + 7);

// auto mod int
// ref. https://github.com/atcoder-live/library/blob/master/mint.cpp
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
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-=(const mint a) {
    if ((x += MOD-a.x) >= 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;
  }
};

vector<ll> primes;
vector<ll> A;

vector<ll> calc_primes(const ll limit) {
    vector<bool> nums(limit + 1, true);
    nums[0] = false;
    nums[1] = false;
    for (int i = 2; i <= (int) limit; i++) {
        if (!nums[i]) continue;
        primes.push_back(i);
        for (int j = i; j <= (int) limit; j += i) {
            nums[j] = false;
        }
    }
    return primes;
}

map<ll, ll> prime_factors(const ll x) {
    map<ll, ll> factors;

    ll rem = x;
    for (int i = 0; i < (int) primes.size(); i++) {
        const int factor = primes[i];
        while (rem % factor == 0) {
            factors[factor]++;
            rem /= factor;
        }
        if (rem == 1) break;
    }
    if (rem != 1) factors[rem]++;

    return factors;
}

int main(void) {
    int N;
    cin >> N;

    A.resize(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    vector<ll> primes = calc_primes((ll) sqrt(MAX_A));
    // 168 primes
    // for (auto &x : primes) {
    //     cout << x << endl;
    // }

    map<ll, ll> prime_counter;
    for (int i = 0; i < N; i++) {
        map<ll, ll> primes = prime_factors(A[i]);

        // printf("primes for %lld\n", A[i]);
        for (auto &p : primes) {
            // printf("%lld: %lld\n", p.first, p.second);
            if (prime_counter[p.first] < p.second) {
                prime_counter[p.first] = p.second;
            }
        }
    }
    // for (auto &p : prime_counter) {
    //     printf("%lld: %lld\n", p.first, p.second);
    // }

    mint lcm(1);
    for (auto &p : prime_counter) {
        lcm *= mint(p.first).pow(p.second);
    }

    mint ans(0);
    for (int i = 0; i < N; i++) {
        mint x = (lcm / mint(A[i]));
        ans += x;
    }

    cout << ans.x << endl;

    return 0;
}


Measured memory_bytes: 896