#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 28;

//=====================modint=====================
// + - * / += -= *= /= ++ -- pow <<,>>,での出力

template <int mod>
struct ModInt {
  int x;

  ModInt() : x(0) {}

  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}

  ModInt &operator+=(const ModInt &p) {
    if ((x += p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &p) {
    if ((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &p) {
    x = (int)(1LL * x * p.x % mod);
    return *this;
  }

  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }

  ModInt operator+() const { return *this; }
  ModInt operator-() const { return ModInt(-x); }
  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
  bool operator==(const ModInt &p) const { return x == p.x; }
  bool operator!=(const ModInt &p) const { return x != p.x; }
  ModInt operator++() { return ModInt(*this) += 1; }
  ModInt operator--() { return ModInt(*this) -= 1; }

  // 使わないほうが良いと思う…
  bool operator<(const ModInt &p) const { return x < p.x; }
  bool operator>(const ModInt &p) const { return x > p.x; }
  bool operator<=(const ModInt &p) const { return x <= p.x; }
  bool operator>=(const ModInt &p) const { return x >= p.x; }

  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while (b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }

  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while (n > 0) {
      if (n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }

  friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; }

  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt<mod>(t);
    return (is);
  }

  static int get_mod() { return mod; }
};

using mint = ModInt<1000000007>;

// 結果を入れたmapを返します
map<ll, int> prime_factor(ll n) {
  map<ll, int> ret;
  for (ll i = 2; i <= sqrt(n); i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  // 2以上で割り切れなかったら
  if (n != 1) ret[n] = 1;
  return ret;
}

// ====================================================================

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

  map<mint, int> lc;
  for (int i = 0; i < n; i++) {
    map<ll, int> res = prime_factor(v[i]);
    for (auto x : res)
      if (lc[x.first] < x.second) lc[x.first] = x.second;
  }

  mint sa = 1;  // 最小公倍数
  for (auto x : lc)
    sa *= x.first.pow(x.second);

  vector<mint> rui(n + 1), rrui(n + 1);

  // 累積積をとって、いい感じに計算する
  rui[0] = rrui[n] = 1;
  for (int i = 0; i < n; i++)
    rui[i + 1] = rui[i] * v[i];
  for (int i = n; i > 0; i--)
    rrui[i - 1] = rrui[i] * v[i - 1];

  mint sowa = 0;
  for (int i = 0; i < n; i++)
    sowa += rui[i] * rrui[i + 1];

  mint sojo = 1;
  for (int i = 0; i < n; i++)
    sojo *= v[i];

  cout << sowa * sa / sojo << endl;
}


Measured memory_bytes: 896