#include <bits/stdc++.h>

using namespace std;
using ll = long long;

template <int T_MOD>
struct ModInt {
  static constexpr int MOD = T_MOD;
private:
  using ll = long long;
  int v;

  static int minv(int a, int m) {
    a %= m;
    if (a < 0) a += m;
    int b = m, u = 0, v = 1;
    while (a) {
      int t = b / a;
      b -= t * a; swap(a, b);
      u -= t * v; swap(u, v);
    }
    assert(b == 1);
    if (u < 0) u += m;
    return u;
  }

public:

  ModInt() : v(0) {}
  template<class T> ModInt(T v_) : v(int(v_ % MOD)) { if (v < 0) v += MOD; }
  explicit operator int() const { return v; }
  friend std::ostream& operator << (std::ostream& out, const ModInt& n) { return out << int(n); }
  friend std::istream& operator >> (std::istream& in, ModInt& n) { ll v_; in >> v_; n = ModInt(v_); return in; }
  friend bool operator == (const ModInt& a, const ModInt& b) { return a.v == b.v; }
  friend bool operator != (const ModInt& a, const ModInt& b) { return a.v != b.v; }

  ModInt inv() const {
    ModInt res;
    res.v = minv(v, MOD);
    return res;
  }

  ModInt neg() const {
    ModInt res;
    res.v = v ? MOD - v : 0;
    return res;
  }

  ModInt operator- () const {
    return neg();
  }

  ModInt operator+ () const {
    return ModInt(*this);
  }

  ModInt& operator ++ () {
    v++;
    if (v == MOD) v = 0;
    return *this;
  }

  ModInt& operator -- () {
    if (v == 0) v = MOD;
    v --;
    return *this;
  }

  ModInt& operator += (const ModInt& o) {
    v += o.v;
    if (v >= MOD) v -= MOD;
    return *this;
  }

  ModInt& operator -= (const ModInt& o) {
    v -= o.v;
    if (v < 0) v += MOD;
    return *this;
  }

  ModInt& operator *= (const ModInt& o) {
    v = int(ll(v) * ll(o.v) % MOD);
    return *this;
  }

  ModInt& operator /= (const ModInt& o) {
    return *this *= o.inv();
  }

  friend ModInt operator ++ (ModInt& a, int) { ModInt r = a; ++a; return r; }
  friend ModInt operator -- (ModInt& a, int) { ModInt r = a; --a; return r; }
  friend ModInt operator + (const ModInt& a, const ModInt& b) { return ModInt(a) += b; }
  friend ModInt operator - (const ModInt& a, const ModInt& b) { return ModInt(a) -= b; }
  friend ModInt operator * (const ModInt& a, const ModInt& b) { return ModInt(a) *= b; }
  friend ModInt operator / (const ModInt& a, const ModInt& b) { return ModInt(a) /= b; }  
};

const int mod = 1000000007;
using Mint = ModInt<mod>;

Mint power(Mint x, int p) {
  Mint ans = Mint(1);
  while(p) {
    if(p & 1) {
      ans *= x;
    }
    x *= x;
    p >>= 1;
  }
  return ans;
}

const int MAXN = 1e6 + 10;
vector<int> spf(MAXN);

void sieve(){
  iota(spf.begin(), spf.end() , 0);
  for (int i = 4 ; i < MAXN ;  i += 2)
    spf[i] = 2;
  for (int i = 3 ; i * i < MAXN ; i++) {
    if (spf[i] == i) {
      for (int j = i * i; j < MAXN ;  j += i)
        if (spf[j] == j)
          spf[j] = i;
    }
  }
}

vector<pair<int, int>> getF(int x){
  vector<pair<int, int>> factors;
  while (x != 1) {
    factors.emplace_back(spf[x], 0);
    int  th = spf[x];
    while(x % th == 0) {
      factors.back().second++;
      x /= th;
    } 
  }
  return factors;
}

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  sieve();
  int n; cin >> n;
  vector<int> ar(n);
  map<int, int> mp;
  vector<Mint> at(n);
  for(int i = 0; i < n; ++i) {
    cin >> ar[i];
    auto get = getF(ar[i]);
    Mint here = 1;
    for(auto x: get) {
      mp[x.first] = max(x.second, mp[x.first]);
      here *= power(Mint(x.first), x.second);
    }
    at[i] = here;
  }
  Mint tot = 1;
  for(auto x: mp) {
    tot *= power(Mint(x.first), x.second);
  }
  Mint res = 0;
  for(int i = 0; i < n; ++i) {
    res += tot / at[i];
  }
  cout << res << '\n';
  return 0;
}


Measured memory_bytes: 4736