#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define endl "\n"
#define ll long long

/* MOD */
ll MOD = 1000000000LL + 7LL;
class Mint {
public:
  ll x;
  Mint() : x(0) {}
  Mint(const int x) {
    if (x < MOD && x >= 0) this->x = x;
    else this->x = (MOD + x % MOD) % MOD;
  }
  Mint(const ll x) {
    if (x < MOD && x >= 0) this->x = x;
    else this->x = (MOD + x % MOD) % MOD;
  }
  Mint(const Mint& c) {
    this->x = c.x;
  }
  Mint& operator=(const int c) {
    if (c < MOD && c >= 0) this->x = c;
    else this->x = (MOD + c % MOD) % MOD;
    return *this;
  }
  Mint& operator=(const ll c) {
    if (c < MOD && c >= 0) this->x = c;
    else this->x = (MOD + c % MOD) % MOD;
    return *this;
  }
  Mint& operator=(const Mint c) {
    this->x = c.x;
    return *this;
  }
  bool operator==(const Mint &b) {
    return x == b.x;
  }
  bool operator!=(const Mint &b) {
    return !(x == b.x);
  }
  bool operator<(const Mint &b) {
    return x < b.x;
  }
  bool operator>(const Mint &b) {
    return x > b.x;
  }
};
ostream &operator<<(ostream& out, const Mint &mint) {
  out << mint.x;
  return out;
}
istream &operator>>(istream& in, const Mint &mint) {
  in >> mint.x;
  return in;
}
inline Mint add(const Mint a, const Mint b) {
  const ll x = (a.x + b.x) % MOD;
  return Mint(x);
}
inline Mint mul(const Mint a, const Mint b) {
  ll x = (a.x * b.x) % MOD;
  return Mint(x);
}
template <typename T>
Mint ModPow(Mint a, T b) {
  assert(b >= 0);
  Mint res = 1;
  while (b)
  {
    if (b & 1)
      res = mul(res, a);
    b >>= 1;
    a = mul(a, a);
  }
  return res;
}
inline Mint ModInverse(const Mint x) {
  ll a = x.x, b = MOD, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    swap(a -= t * b, b);
    swap(u -= t * v, v);
  }
  Mint res(u);
  return res;
}
inline Mint operator-(const Mint x) {
  return Mint(-x.x);
}
inline Mint operator+(const Mint a, const Mint b) {
  return add(a, b);
}
inline Mint operator*(const Mint a, const Mint b) {
  return mul(a, b);
}
inline Mint operator-(const Mint a, const Mint b) {
  return add(a, -b);
}
template<typename T>
inline Mint operator+(const Mint a, const T b) {
  return add(a, Mint(b));
}
template<typename T>
inline Mint operator*(const Mint a, const T b) {
  return mul(a, Mint(b));
}
template<typename T>
inline Mint operator-(const Mint a, const T b) {
  return add(a, Mint(-b));
}
template<typename T>
inline Mint operator/(const Mint a, const T b) {
  return mul(a, ModInverse(Mint(b)));
}
template<typename T>
inline Mint operator^(const Mint a, const T b) {
  return ModPow(a, b);
}
template<typename T>
inline Mint operator+=(Mint& a, const T b) {
  a = a + b;
  return a;
}
template<typename T>
inline Mint operator-=(Mint& a, const T b) {
  a = a - b;
  return a;
}
template<typename T>
inline Mint operator*=(Mint& a, const T b) {
  a = a * b;
  return a;
}
template<typename T>
inline Mint operator/=(Mint& a, const T b) {
  a = a / b;
  return a;
}

int n;
int a[10001];
vector<pair<int, int> > v[10001];
map<int, int> _max;

int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    int now = a[i];
    for (int j = 2; j * j <= now; j++) {
      int cnt = 0;
      while (now % j == 0) {
        cnt++;
        now /= j;
      }
      if (cnt > 0) v[i].pb(mp(j, cnt));
    }
    if (now > 1) {
      v[i].pb(mp(now, 1));
    }
    for (int j = 0; j < (int)v[i].size(); j++) _max[v[i][j].fi] = max(_max[v[i][j].fi], v[i][j].se);
  }
  Mint gcd = 1;
  for (auto ite = _max.begin(); ite != _max.end(); ite++) {
    gcd = gcd * ModPow(ite->fi, ite->se);
  }
  Mint ans = 0;
  for (int i = 0; i < n; i++) {
    Mint now = gcd;
    for (int j = 0; j < (int)v[i].size(); j++) {
      now = now / ModPow(v[i][j].fi, v[i][j].se);
    }
    ans = ans + now;
  }
  cout << ans << endl;
}


Measured memory_bytes: 1280