#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>
#include <cstdint>



#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rrep(i, n) for(ll i = (ll)(n-1); i >= 0; i--)
#define repi(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rrepi(i,a,b) for(ll i=(ll)(b-1);i>=(ll)(a);i--)

#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;


template <std::uint_fast64_t Modulus> class modint {
  using u64 = std::uint_fast64_t;

public:
  u64 a;

  modint(const u64 x = 0) noexcept : a(x % Modulus) {}
  u64 &value() noexcept { return a; }
  u64 &value() const noexcept { return a; }
  modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= Modulus) {
      a -= Modulus;
    }
    return *this;
  }
  modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += Modulus;
    }
    a -= rhs.a;
    return *this;
  }
  modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % Modulus;
    return *this;
  }
  modint &operator/=(modint rhs) noexcept {
    u64 exp = Modulus - 2;
    while (exp) {
      if (exp % 2) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
  modint pow(u64 exp){
    modint res=1,rhs=*this;
    while (exp) {
      if (exp % 2) {
        res *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return res;
  }

  friend ostream& operator<<(ostream& os,modint& rhs){
    os << rhs.value();
    return os;
  }

  friend istream& operator>>(istream &is,modint &rhs){
      is>>rhs.value();
      rhs.value()%=Modulus;
      return is;
  }

};

using mint=modint<(int)1e9+7>;
struct factorial{
  vector<mint>fact,inv;
  factorial(int n){
    fact.assign(n,0);
    inv.assign(n,0);
    fact[0]=1;
    for(int i=0;i<n-1;i++){
      fact[i+1]=fact[i]*(i+1);
    }
    inv[n-1]=(mint)1/fact[n-1];
    for(int i=n-1;i>=1;i--){
      inv[i-1]=inv[i]*i;
    }
  }
  mint comb(int a,int b){
    if(b>a||b<0)return 0;
    return fact[a]*inv[b]*inv[a-b];
  }

};
ll gcd(ll a,ll b)
{
  if(a>b)swap(a,b);
  if(a==0){return b;}
  else return gcd(b%a,a);
}
map<ll,ll>prime_factor(int m)
{
  map<ll,ll>res;
  ll sqrm=sqrt(m)+1;
  for(int i=2;i<sqrm+1;i++)
  {
    while(m%i==0){res[i]++;m/=i;}
    if(m==1)break;
  }
  if(m>1)res[m]++;
  return res;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin>>n;
  vector<ll>a(n);
  map<ll,ll>ma;
  rep(i,n){
    cin>>a[i];
    auto tma=prime_factor(a[i]);
    for(auto tp:tma){
      chmax(ma[tp.first],tp.second);
    }
  }
  mint res=1;
  for(auto tp:ma){
    mint tr=tp.first;
    tr=tr.pow(tp.second);
    res*=tr;
  }
  mint wei(0);
  rep(i,n){
    wei+=(mint(1))/a[i];
  }
  res*=wei;
  cout<<res<<endl;



  return 0;

}


Measured memory_bytes: 1024