#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
const int INF = 2147483647;
const ll MOD = 1000000007;

template <std::uint_fast64_t MOD> class ModInt {
  using u64 = std::uint_fast64_t;

public:
  ModInt(const u64 val = 0) { value = val % MOD; }

  ModInt operator+(const ModInt rhs) const { return ModInt(*this) += rhs; }
  ModInt operator-(const ModInt rhs) const { return ModInt(*this) -= rhs; }
  ModInt operator*(const ModInt rhs) const { return ModInt(*this) *= rhs; }
  ModInt operator/(const ModInt rhs) const { return ModInt(*this) /= rhs; }

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

  ModInt &operator-=(const ModInt rhs) {
    if (value < rhs.value) {
      value += MOD;
    }
    value -= rhs.value;
    return *this;
  }

  ModInt &operator*=(const ModInt rhs) {
    value = value * rhs.value % MOD;
    return *this;
  }

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

  ModInt &operator++(int n) {
    value++;
    if (value >= MOD) {
      value -= MOD;
    }
    return *this;
  }

  ModInt &operator--(int n) {
    if (value == 0) {
      value += MOD;
    }
    value--;
    return *this;
  }

  ModInt inv() { return ModInt::pow(*this, MOD - 2); }

  static ModInt pow(ModInt base, long long int n) {
    ModInt res = ModInt(1);
    while (n) {
      if (n & 1) {
        res *= base;
      }
      base *= base;
      n /= 2;
    }
    return res;
  }

  static ModInt comb(ModInt n, ModInt r) { return comb(n.value, r.value); }

  static ModInt comb(int n, int r) {
    if (n < r)
      return ModInt(0);
    ModInt res = ModInt(1);
    ModInt el = ModInt(1);
    for (int i = 1; i < n + 1; i++) {
      res *= el;
      el++;
    }

    ModInt inv = ModInt(1);
    el = ModInt(1);
    for (int i = 1; i < r + 1; i++) {
      inv *= el;
      el++;
    }
    el = ModInt(1);
    for (int i = 1; i < n - r + 1; i++) {
      inv *= el;
      el++;
    }
    res *= inv.inv();
    return res;
  }

  u64 getValue() const { return value; }

private:
  u64 value;
};

// ここを問題ごとのMODに書き換える
using mint = ModInt<1000000007>;

std::ostream &operator<<(std::ostream &out, const mint &m) {
  out << m.getValue();
  return out;
};

std::istream &operator>>(std::istream &in, mint &m) {
  uint_fast64_t i;
  in >> i;
  m = mint(i);
  return in;
}

using namespace std;

int main() {
  vector<int> minfactor(1000001);
  vector<int> isPrime(1000001);
  REP(i, 1000001) {
    isPrime[i] = true;
    minfactor[i] = -1;
  }
  isPrime[0] = false;
  minfactor[0] = -1;
  isPrime[1] = false;
  minfactor[1] = -1;
  for (int i = 2; i < 1000001; i++) {
    if (!isPrime[i])
      continue;
    minfactor[i] = i;
    for (int k = 2; i * k < 1000001; k++) {
      isPrime[i * k] = false;
      if (minfactor[i * k] == -1)
        minfactor[i * k] = i;
    }
  }

  int n;
  cin >> n;
  vl a(n);
  REP(i, n) { cin >> a[i]; }
  // 素因数iを何個持つか
  vector<ll> lcm(1000001, 0LL);
  REP(j, n) {
    int tmp = a[j];
    int cur = minfactor[a[j]];
    ll c = 0;
    while (minfactor[tmp] != -1) {
      c++;
      tmp /= minfactor[tmp];
      if (cur != minfactor[tmp]) {
        lcm[cur] = max(lcm[cur], c);
        c = 0;
        cur = minfactor[tmp];
      }
    }
  }

  mint l = mint(1);
  REP(i, 1000001) {
    if (lcm[i] != 0) {
      l *= mint::pow(mint(i), lcm[i]);
    }
  }
  mint ans = mint(0);
  REP(i, n) { ans += l / mint(a[i]); }
  cout << ans << endl;
}


Measured memory_bytes: 16000