#include <bits/stdc++.h>

#define rep(n, i) for (int i = 0; i < (n); ++i)

using ll = long long;
using namespace std;

template <long long N>
class Modulo {
 public:
  using Type = decltype(N);
  // constructor
  constexpr Modulo (Type n = 0) : number_((N + n) % N) {}
  // unary operator
  constexpr auto operator - () const {
    return Modulo(-number_);
  }
  constexpr auto operator ~ () const {
    // Only if N is prime, and number_ and N are coprime
    return power(*this, N - 2);
  }
  // compound assign operator
  constexpr auto & operator += (const Modulo & m) {
    number_ = (number_ + m.number_) % N;
    return *this;
  }
  constexpr auto & operator -= (const Modulo & m) {
    return *this += -m;
  }
  constexpr auto & operator *= (const Modulo & m) {
    number_ = (number_ * m.number_) % N;
    return *this;
  }
  constexpr auto & operator /= (const Modulo & m) {
    return *this *= ~m;
  }
  // binary operator with type conversion
  constexpr friend auto operator + (Modulo lhs, const Modulo & rhs) {
    return lhs += rhs;
  }
  constexpr friend auto operator - (Modulo lhs, const Modulo & rhs) {
    return lhs -= rhs;
  }
  constexpr friend auto operator * (Modulo lhs, const Modulo & rhs) {
    return lhs *= rhs;
  }
  constexpr friend auto operator / (Modulo lhs, const Modulo & rhs) {
    return lhs /= rhs;
  }
  // friend function
  constexpr friend auto power (const Modulo & m, Type exponent) {
    constexpr auto unit = Modulo(1);
    if ( exponent == 0 ) return unit;
    return (exponent & 1 ? m : unit) * power(m*m, exponent >> 1);
  }
  constexpr friend auto number (const Modulo & m) {
    return m.number_;
  }
  // stream operator
  friend auto & operator << (std::ostream & os, const Modulo & m) {
    return os << number(m);
  }
 private:
  Type number_;
};

template <int N>
class Factorizer {
 public:
  Factorizer () {
    table_.fill(0);
    for (int i = 2; i <= N; ++i) {
      if (table_[i]) continue;
      // Now, i is prime
      for (int j = i; j <= N; j += i) {
        if (table_[j]) continue;
        table_[j] = i;
      }
    }
  }
  auto factorList (int n) {
    vector<int> list;
    while ( 2 <= n ) {
      list.push_back(table_[n]);
      n /= table_[n];
    }
    return list;
  }
 private:
  array<int, N + 1> table_;
};

template <typename T, int N>
class Factor {
 public:
  explicit Factor (int n) {
    for (auto p : factorList(n)) {
      factor_[p]++;
    }
  }
  auto expand () const {
    auto res = T(1);
    for (auto p : factor_) {
      res *= power(T(p.first), p.second);
    }
    return res;
  }
  void merge (const Factor & f) {
    for (auto p : f.factor_) {
      auto & count = factor_[p.first];
      count = max(count, p.second);
    }
  }
 private:
  static auto factorList (int n) {
    static auto x = Factorizer<N>();
    return x.factorList(n);
  }
  map<int, int> factor_;
};

int
main ()
{
    using Number = Modulo<1'000'000'007ll>;
    using Factor = Factor<Number, 1'000'000>;

    int n;
    cin >> n;

    auto f = Factor(1);
    vector<int> a(n);
    for (auto & e : a) {
      cin >> e;
      f.merge(Factor(e));
    }

    auto lcm = f.expand();
    auto answer = Number(0);
    for (auto e : a) {
      answer += lcm / e;
    }

    std::cout << answer << std::endl;
}


Measured memory_bytes: 4608