#include <iostream>
#include <iomanip> //! for setprecision(10)
#include <math.h>
#include <algorithm>
#include <functional> 
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>

using namespace std;

typedef long long LL;

#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 
#define dumpMap(c) { for (auto it = c.begin(); it != c.end(); ++it) cout << it->first << " => " << it->second << endl; } 
#define rep(i,n) for (int i = 0; i < (n); ++i)

const int MOD = 1000000007;

class Mint {
public:
  typedef long long val_type;

  Mint(val_type x=0, int m=MOD) : val((x%m+m)%m), mod(m) {}
  val_type value() const { return val; }
  Mint& operator+=(const Mint a) {
    if ((val += a.val) >= mod) val -= mod;
    return *this;
  }
  Mint& operator-=(const Mint a) {
    if ((val += mod-a.val) >= mod) val -= mod;
    return *this;
  }
  Mint& operator*=(const Mint a) {
    (val *= a.val) %= mod;
    return *this;
  }
  Mint operator+(const Mint a) const {
    Mint res(*this);
    return res+=a;
  }
  Mint operator-(const Mint a) const {
    Mint res(*this);
    return res-=a;
  }
  Mint operator*(const Mint a) const {
    Mint res(*this);
    return res*=a;
  }
  Mint pow(val_type 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 {
    Mint res(*this);
    return res/=a;
  }

private:
  val_type val;
  int mod;
};

typedef vector<pair<int, int>> FACTORS;

class Sieve {
public:
    Sieve(int size) : sieve(size+1) {
        sieve[0] = -1;
        sieve[1] = -1;
        for (int i = 2; i <= size; ++i) {
            if (!sieve[i]) {
                sieve[i] = i;
                for (LL j = (LL) i * i; j <= (LL) size; j += i) {
                    if (!sieve[j]) {
                        sieve[j] = i;
                    }
                }
            }
        }
    }

    bool isPrime(int x) {
        return (sieve[x] == x);
    }

    void getFactors(int x, vector<int>& out) {
        while (1 < x) {
            int f = sieve[x];
            out.push_back(f);
            x /= f;
        }
    }

    void factorize(int x, FACTORS& factors) {
        vector<int> fs;
        getFactors(x, fs);
        if (!fs.empty()) {
            factors.push_back({fs[0], 0});            
            for (int f: fs) {
                if (factors.back().first != f) {
                    factors.push_back({f, 0});        
                }
                ++factors.back().second;
            }
        }
    }

private:
    vector<int> sieve;
};


//! merge foctors in src to dest
void mergeFactors(FACTORS& dest, const FACTORS& src) 
{
    auto is = src.begin();
    auto id = dest.begin();
    FACTORS m;
    while (is != src.end() || id != dest.end()) {
        if (is == src.end()) {
            while (id != dest.end()) {
                m.push_back(*id);
                ++id;
            }
        } else if (id == dest.end()) {
            while (is != src.end()) {
                m.push_back(*is);
                ++is;
            }
        } else {
            if (is->first == id->first) {
                m.push_back({is->first, max(is->second, id->second)});
                ++is;
                ++id;
            } else if (is->first < id->first) {
                m.push_back(*is);
                ++is;
            } else {
                m.push_back(*id);
                ++id;
            }
        }
    }
    dest.swap(m);
}


int main()
{
	cin.tie(0);
	ios::sync_with_stdio(0);

    Sieve sieve(1000000);

    int N;
    cin >> N;
    vector<int> A(N);
    vector<FACTORS> f(N);
    rep(i, N) {
        cin >> A[i];
        sieve.factorize(A[i], f[i]);
    }

    FACTORS fLcm;
    rep(i, N) {
        mergeFactors(fLcm, f[i]);
    }

    Mint mLcm(1);
    for (auto p: fLcm) {
        mLcm *= Mint(p.first).pow(p.second);
    }

    Mint ans;
    rep(i, N) {
        Mint b(1);
        for (auto p: fLcm) {
            if (0 < p.second) {
                b *= Mint(p.first).pow(p.second);
            }
        }
        ans += mLcm / Mint(A[i]);
    }

    cout << ans.value() << endl;

    return 0;
}


Measured memory_bytes: 5248