#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <bitset>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <cmath>
#include <limits>
#include <numeric>
#include <iomanip>
#include <cstdlib>
#include <iterator>
#include <functional>
#include <unordered_map>
#include <unordered_set>

using namespace std;

typedef unsigned                    ui;
typedef int                         si;
typedef long                        sl;
typedef long long                   ll;
typedef unsigned long long          ull;

// ----------------

template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

// ----------------

const ll mod = 1000000007;

template <typename T>
struct PairHash {
  size_t operator() (const pair<T, T>& v) const {
    return hash<ll>()((static_cast<ll>(v.first)) ^ (static_cast<ll>(v.second)) << 32);
  }
};

vector<ll> seave(const ll n) {
    vector<ll> primes;
    vector<ll> lpd(n + 1, 0);
    for (ll i = 2; i <= n; ++i) {
        if (lpd[i] == 0) {
            primes.emplace_back(i);
            lpd[i] = i;
        }

        for (int j = 0; j < primes.size() && primes[j] * i <= n && primes[j] <= lpd[i]; ++j) {
            lpd[primes[j] * i] = primes[j];
        }
    }

    return primes;
}

unordered_map<int, int> factorization_slow(ll n) {
    unordered_map<int, int> result;
    for (int i = 2; i * i <= n; ++i) {
        while (n % i == 0) {
            result[i] += 1;
            n /= i;
        }
    }

    if (n > 1) {
        result[n] += 1;
    }

    return result;
}

unordered_map<int, int> factorization_opt1(ll n) {
    unordered_map<int, int> result;
    while (n % 2 == 0) {
        result[2] += 1;
        n /= 2;
    }
    for (int i = 3; i * i <= n; i += 2) {
        while (n % i == 0) {
            result[i] += 1;
            n /= i;
        }
    }

    if (n > 1) {
        result[n] += 1;
    }

    return result;
}

unordered_map<int, int> factorization_opt2(ll n) {
    unordered_map<int, int> result;
    while (n % 2 == 0) {
        result[2] += 1;
        n /= 2;
    }
    for (int i = 3; i * i <= n; i += 2) {
        while (n % i == 0) {
            result[i] += 1;
            n /= i;
        }
    }

    if (n > 1) {
        result[n] += 1;
    }

    return result;
}

unordered_map<int, int> factorization_primes(ll n, const vector<ll>& primes) {
    unordered_map<int, int> result;
    for (const ll prime : primes) {
        if (prime * prime > n) {
            break;
        }

        while (n % prime == 0) {
            result[prime] += 1;
            n /= prime;
        }
    }

    if (n > 1) {
        result[n] += 1;
    }

    return result;
}

unordered_map<int, int> mult(const unordered_map<int, int>& a, const unordered_map<int, int>& b) {
    unordered_map<int, int> result = a;
    for (const pair<int, int>& prime : b) {
        result[prime.first] += prime.second;
    }

    return result;
}

unordered_map<int, int> div(const unordered_map<int, int>& a, const unordered_map<int, int>& b) {
    unordered_map<int, int> result = a;
    for (const pair<int, int>& prime : b) {
        unordered_map<int, int>::iterator found = result.find(prime.first);
        if (found == result.end() || found->second < prime.second) {
            return {};
        }

        found->second -= prime.second;
        if (found->second == 0) {
            result.erase(found);
        }
    }

    return result;
}

// ll div(const unordered_map<int, int>& a, const unordered_map<int, int>& b) {
//     ll result = 0;
//     for (const pair<int, int>& prime : b) {
//         unordered_map<int, int>::const_iterator found = a.find(prime.first);
//         if (found == a.end() || found->second < prime.second) {
//             return {};
//         }
//
//         result += prime.first * (found->second - prime.second);
//     }
//
//     return result;
// }

ll fast_pow(ll n, ll p) {
    if (p == 0) {
        return 1;
    } else if (p == 1) {
        return n;
    }

    if (p % 2 == 0) {
        ll halved = fast_pow(n, p / 2);
        return halved * halved;
    } else {
        return fast_pow(n, p - 1) * n;
    }
}

ll from_factorization(const unordered_map<int, int>& factors, const ll mod) {
    if (factors.empty()) {
        return 1;
    }

    ll result = 1;
    for (const pair<int, int>& prime : factors) {
        debug(prime.first, prime.second, fast_pow(prime.first, prime.second));
        result *= fast_pow(prime.first, prime.second);
        result %= mod;
    }

    return result;
}

template <typename T>
T extended_euclid(T a, T b, T& x, T& y) {
    if (a == 0) {
        x = 0;
        y = 1;
        return b;
    }

    T x1, y1;
    const T g = extended_euclid(b % a, a, x1, y1);

    x = y1 - (b / a) * x1;
    y = x1;

    return g;
}

ll mod_inverse(ll a, ll m) {
    ll x, y;
    ll g = extended_euclid(a, m, x, y);

    debug(a, m, x, y, g);

    return (x % m + m) % m;
}

int main(int argc, char *argv[])
{
    std::ios_base::sync_with_stdio(false);

    ll n;
    cin >> n;

    vector<ll> a(n, 0);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }

    const vector<ll> primes = seave(1000001);
    vector<unordered_map<int, int>> factors;

    // debug(primes);

    unordered_map<int, int> lcm;
    for (int i = 0; i < n; ++i) {
        factors.emplace_back(factorization_primes(a[i], primes));
        for (const pair<int, int>& prime : factors[i]) {
            lcm[prime.first] = max(lcm[prime.first], prime.second);
        }
        debug(factors[i]);
    }

    debug(lcm);

    ll lcm_mod = 1;
    for (const pair<int, int>& factor : lcm) {
        lcm_mod *= fast_pow(factor.first, factor.second);
        lcm_mod %= mod;
    }

    debug(lcm_mod);
    ll answer = 0;
    for (int i = 0; i < n; ++i) {
        answer += (lcm_mod * mod_inverse(a[i], mod)) % mod;
        answer %= mod;
    }

    cout << answer << endl;

    return 0;
}


Measured memory_bytes: 9336