#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long int
#define INF 1e9
#define LINF 1e18
#define MOD 1000000007
#define PI 3.14159265359
#define eps 1e-10
#define All(a) (a).begin(), (a).end()

using namespace std;
using P = pair<ll, ll>;
 
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

/**
 * Usage:
 * 
 * G[from].push_back(Edge(to, weight));
 * using Graph = vector<vector<Edge>>;
 * 
 */ 
struct Edge {
  int to;     
  ll weight; 
  Edge(int t, ll w) : to(t), weight(w) { }
};

/**
 * Usage:
 * 
 * chmin(old, new);
 * chmax(old, new);
 * 
 */ 
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

template<typename T>
void printv(vector<T>& v) {
  if (v.size() == 0) {
    cout << "\n";
    return;
  }

  Rep(i, v.size()) {
    cout << v[i] << ((i + 1 < v.size()) ? ' ' : '\n');
  }
}



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 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 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 modint = ModInt<MOD>;


int N;
ll a[1100000];

int main () {
  cin >> N;
  rep(i, N) cin >> a[i];

  map<ll, int> saiko;

  rep(k, N) {
    map<ll, int> ret;
    ll m = a[k];

    for(ll i = 2; i * i <= m; i++) {
      while(m % i == 0) {
        ret[i]++;
        m /= i;
      }

      saiko[i] = max(saiko[i], ret[i]);
    }
    if(m != 1) {
      saiko[m] = max(saiko[m], 1);
    }
  }

  modint b = 1;

  for (auto kv: saiko) {
    Rep(i, kv.second) {
      b *= kv.first;
    }
  }

  modint ans;
  //cout << b << "\n";

  rep(k, N) {
    modint tmp = b / a[k];
    //out << tmp << "\n";
    ans += tmp;
  }

  cout << ans << "\n";
}

Measured memory_bytes: 1024