/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-01-20 00:17:54
**/

#include <iostream>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
#include <bitset>
#include <cassert>
#include <cctype>
#include <iomanip>
#include <random>
#include <utility>
#include <chrono>

using namespace std;

using int64 = long long;

template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) { os << '{'; size_t n = vec.size(); for (size_t i = 0; i < n; ++i) { os << vec[i]; if (i != n - 1) os << ','; } os << '}'; return os; }
template<class T, class U> std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) { return os << '{' << p.first << " " << p.second << '}'; }
template<class T> std::istream& operator>>(std::istream& is, std::vector<T>& vec) { size_t n = vec.size(); for (size_t i = 0; i < n; ++i) is >> vec[i]; return is; }

template<class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  for (auto key : mp) {
    os << '{' << key.first << ',' << key.second << '}';
  }
  return os;
}

#ifdef LOCAL
#define debug(_) cerr << #_ << ": " << (_) << '\n'
#else
#define debug(_) 1728
#endif

template<class T> T mod_pow(T x, T n, T mod) {
  T res = 1;
  while (n > 0) {
    if (n & 1) (res *= x) %= mod;
    (x *= x) %= mod;
    n >>= 1;
  }
  return res;
}

class Combination {
 public:
  constexpr Combination() { Build(); }
  static constexpr int mod_ = 1000000007;
  static constexpr int n_ = 1000000 + 5;
  struct LookupTable {
    int64 factorial_[n_];
    int64 inverse_[n_];
    int64 finverse_[n_];
  };
  LookupTable lt{};

  // return nCk
  constexpr int64 Get(int n, int k) const noexcept {
    if (n < k || n < 0 || k < 0) return 0;
    return lt.factorial_[n] * (lt.finverse_[k] * lt.finverse_[n - k] % mod_) %
           mod_;
  }

 private:
  constexpr void Build() noexcept {
    lt.factorial_[0] = 1;
    lt.factorial_[1] = 1;
    lt.finverse_[0] = 1;
    lt.finverse_[1] = 1;
    lt.inverse_[1] = 1;
    for (int i = 2; i < n_; ++i) {
      lt.factorial_[i] = lt.factorial_[i - 1] * i % mod_;
      lt.inverse_[i] = mod_ - lt.inverse_[mod_ % i] * (mod_ / i) % mod_;
      lt.finverse_[i] = lt.finverse_[i - 1] * lt.inverse_[i] % mod_;
    }
  }
} kyomu;

constexpr int64 MOD = 1e9 + 7;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int n; cin >> n;
  vector<int64> p(n);
  cin >> p;

  vector<int64> p2 = p;

  map<int64, int64> mp;

  for (int i = 0; i < n; ++i) {
    for (int64 j = 2; j * j <= p[i]; ++j) {
      if (p[i] % j != 0) continue;
      int64 cnt = 0;
      while (p[i] % j == 0) {
        p[i] /= j;
        ++cnt;
      }
      mp[j] = max(mp[j], cnt);
    }
    if (p[i] != 1LL) mp[p[i]] = max(mp[p[i]], 1LL);
  }

  debug(mp);

  int64 ans = 0;

  int64 lcm_ = 1;

  for (auto x : mp) {
    lcm_ *= mod_pow(x.first, x.second, MOD);
    lcm_ %= MOD;
  }

  for (int i = 0; i < n; ++i) {
    ans += lcm_ * kyomu.lt.inverse_[p2[i]] % MOD;
    ans %= MOD;
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1024