#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(ll i = a;i < b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = b-1;i >= a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

const ll INF=(1LL<<50);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif

template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}

const long long MOD = 1000000007;

template<typename T> 
int sgn(T val){
  return (T(0)<val)-(val<T(0));
}

tuple<long long,long long,long long> egcd(long long a,long long b){
  if(a==0||b==0)return std::make_tuple(0LL,0LL,0LL);
  long long sa=sgn(a),sb=sgn(b);
  a=std::abs(a);b=std::abs(b);
  long long p=1,q=0,r=0,s=1;
  while(b>0){
    long long c=a/b;
    long long d;
    d=a;a=b;b=d%b;
    d=p;p=q;q=d-c*q;
    d=r;r=s;s=d-c*s;
  }
  return std::make_tuple(a,p*sa,r*sb);
}
long long eulerPhi(long long n){
  if(n==0)return 0;
  static map<long long,long long> cache;
  if(cache.count(n))return cache[n];
  long long ans=n;
  for (long long i = 2; i*i <= n; i++) {
    if(n%i==0){
      ans-=ans/i;
      while(n%i==0)n/=i;
    }
  }
  if(n>1)ans-=ans/n;
  cache[n]=ans;
  return ans;
}
long long inverse(long long a,long long m){
  static map<long long,long long> cache;
  if(cache.count(a)>0){
    return cache[a];
  }
  auto b=egcd(a,m);
  if(std::get<0>(b)!=1)return 0;
  cache[a]=(std::get<1>(b)<0)?std::get<1>(b)+m:std::get<1>(b);
  return cache[a];
}
template<long long m>
class Modulo{
  long long a;
public:
  Modulo(const long long b){
    a=(b%m+m)%m;
  }
  Modulo(const Modulo& b){
    a=b.a;
  }
  Modulo &operator = (const long long b){
    a=(b%m+m)%m;
    return *this;
  }
  Modulo &operator = (const Modulo& b){
    a=b.a;
    return *this;
  }
  Modulo operator + (const Modulo<m> &b)const{
    return {(a+b.a)%m};
  }
  Modulo operator - (const Modulo<m> &b)const{
    return {(a-b.a+m)%m};
  }
  Modulo operator * (const Modulo<m> &b)const{
    return {(a*b.a)%m};
  }
  Modulo operator / (const Modulo<m> &b)const{
    return {(a*inverse(b,m))%m};
  }
  Modulo operator + (const long long b)const{
    return {(a+b)%m};
  }
  Modulo operator - (const long long b)const{
    return {((a-b)%m+m)%m};
  }
  Modulo operator * (const long long b)const{
    return {(a*b)%m};
  }
  Modulo operator / (const long long b)const{
    return {(a*inverse(b%m,m))%m};
  }
  Modulo operator < (const Modulo<m> &b)const{
    return a<b.a;
  }
  Modulo operator > (const Modulo<m> &b)const{
    return a>b.a;
  }
  operator long long() const{return a;}
};

template<long long m>
Modulo<m> modpow(Modulo<m> a,long long b){
  long long c;
  long long mod_pow=eulerPhi(m);
  if(b>64){
    c=64%mod_pow;
    b=b%mod_pow;
    if(c>b){
      b=b+mod_pow;
    }
    c=64+(b-c);
  }else{
    c=b;
  }
  b=c;
  Modulo<m> base=a,ans=Modulo<m>(1LL);
  while(b){
    if(b&1){
      ans=ans*base;
    }
    base=base*base;
    b>>=1;
  }
  return ans;
}

void solve(long long N, std::vector<long long> A){
  map<ll,ll> p;
  p[2]=0;
  for (ll i = 3; i*i <= 1000000; i+=2)
  {
    bool f=true;
    for (auto &&j : p)
    {
      if(i%j.first==0){
        f=false;
        break;
      }
    }
    if(f){
      p[i]=0;
    }
  }
  REP(N){
    ll X=A[i];
    for (auto &&j : p)
    {
      ll cnt=0;
      while(X%j.first==0){
        X/=j.first;
        ++cnt;
      }
      j.second=max(j.second,cnt);
    }
    if(X>1)
      p[X]=1;
  }
  Modulo<MOD> l(1);
  for (auto &&j : p)
  {
    REP(j.second){
      l=l*j.first;
    }
  }
  Modulo<MOD> ans(0);
  REP(N){
    ans=ans+(l/A[i]);
  }
  cout<<(ll)(ans)<<endl;
}

int main(){
  cout<<setprecision(1000);
  cin.tie(0);
  ios::sync_with_stdio(false);
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 1664