#include <bits/stdc++.h>
#define repz(i, z, n) for (decltype(n) i = (z); i < (n); i++)
#define rep(i, n) for (decltype(n) i = 0; i < (n); i++)

#define REPZ(i, z, n) for (decltype(n) i = (z); i <= (n); i++)
#define REP(i, n) for (decltype(n) i = 0; i <= (n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(v) ((ll)(v).size())
#define MAX(v) (*max_element(ALL(v)))
#define MIN(v) (*min_element(ALL(v)))
#define INF 1000000000000  // 1E+12

// 略
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define READ cin >>
#define PRINT cout <<
#define PYES cout << "Yes" << endl;
#define POK cout << "OK" << endl;
#define PNO cout << "No" << endl;
#define PNG cout << "NG" << endl;

using namespace std;

// デバッグ用
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

// typedef
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;
typedef pair<ll, ll> pl;

// const
// 円周率
const ld pi = acos(-1);
// mod用
// 1E+9 +7
const ll mod = (int)1e+9 + 7;
// 1s間で可能なループ回数2E+8回
// int        最大値2147483647         〜2E+9
// long long  最大値9223372036854775807〜9E+18
// 総和accumulate
// 単純リストvector<type> push_back
// 連想配列map<key,value> insert,
// 集合set<type>
// pair キーとバリューを格納 firstとsecondでアクセス
// 小数点指定 cout << fixed << setprecision(15) << endl;
// to_string<->stoi
// stoll(longlong)
// stod(double)
// deep copy v1->v2 copy(v1.begin(), v1.end(), back_inserter(v2) );
// 大文字65-90(-32)
// 小文字97-122(+32)
//  priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>
//  ba;
ll _gcd(ll a, ll b) { return b != 0 ? _gcd(b, a % b) : a; }
struct mint {
  ll x;  // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint &operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint &operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint &operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream &operator>>(istream &is, const mint &a) { return is >> a.x; }
ostream &operator<<(ostream &os, const mint &a) { return os << a.x; }

map<ll, ll> decompositPrime(ll n) {
  map<ll, ll> res;
  ll a = 2;
  while (n >= a * a) {
    if (n % a == 0) {
      n /= a;
      if (res.count(a) == 0) res[a] = 0;
      res[a]++;
    } else {
      a++;
    }
  }
  if (n > 1) {
    if (res.count(n) == 0) res[n] = 0;
    res[n]++;
  }

  return res;
}
signed main() {
  // faster
  // C言語流の入出力は使用できない
  //
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  ll n;
  cin >> n;
  vector<ll> a(n);
  vector<pl> preb(n);
  set<ll> denominator;
  rep(i, n) cin >> a[i];
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  repz(i, 1, n) {
    ll g = _gcd(a[i], a[0]);
    preb[i] = MP(a[0] / g, a[i] / g);
    denominator.insert(a[i] / g);
  }
  map<ll, ll> l;
  for (ll i : denominator) {
    if (SIZE(l) == 0) {
      l = decompositPrime(i);
      continue;
    }
    map<ll, ll> temp = decompositPrime(i);
    for (pair<ll, ll> j : temp) {
      ll newpower = max(j.second, l[j.first]);
      l[j.first] = newpower;
    }
  }

  vector<mint> b(n);
  b[0] = 1;
  for (pair<ll, ll> i : l) {
    debug(i.first, i.second);
    rep(j, i.second) { b[0] *= i.first; }
  }
  vector<pair<mint, mint>> prebm(n);
  rep(i, n) {
    prebm[i].F = preb[i].F;
    prebm[i].S = preb[i].S;
  }
  repz(i, 1, n) { b[i] = prebm[i].first / prebm[i].second * b[0]; }
  mint res = 0;
  rep(i, n) { res += b[i]; }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 1792