#include <iostream>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <assert.h>
#include <memory.h>
#include <time.h>
#include <bitset>
#include<iomanip>
#include<float.h>
 
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = (l); i < (r); i++)
#define repb(i, r, l) for (int i = (r); i > (l); i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define pii pair<int,int>
#define pli pair<ll,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define mp(a, b) make_pair(a, b)
#define mt(a,b,c) make_tuple(a,b,c)
#define rank qwertyuio
#define next dfghjk
#define plus fsghsf
#define minus ytryr
#define pb push_back
#define debug(x) cerr<<#x<<": "<<(x)<<endl
using namespace std;
 
inline bool setmin(int &x, int y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(int &x, int y) { return (y > x) ? x = y, 1 : 0; }
inline bool setmin(ll &x, ll y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(ll &x, ll y) { return (y > x) ? x = y, 1 : 0; }
 
const int N = 100000;
const int inf = (int)1e9 + 1;
const ll big = (ll)1e18 + 1;
const int P = 239;
const int P1 = 31;
const int P2 = 57;
const int mod = (int)1e9 + 7;
const int mod1 = (int)1e9 + 9;
const int mod2 = 998244353;
const int mod3 = (int)1e6+3;
const ld eps = 1e-12;
const double pi = atan2(0, -1);
const int ABC = 26;
 void lineFromPoints(pdd P, pdd Q, double &a, 
                        double &b, double &c) 
{ 
    a = Q.second - P.second; 
    b = P.first - Q.first; 
    c = a*(P.first)+ b*(P.second); 
} 
  
// Function which converts the input line to its 
// perpendicular bisector. It also inputs the points 
// whose mid-point lies on the bisector 
void perpendicularBisectorFromLine(pdd P, pdd Q, 
                 double &a, double &b, double &c) 
{ 
    pdd mid_point = make_pair((P.first + Q.first)/2, 
                            (P.second + Q.second)/2); 
  
    // c = -bx + ay 
    c = -b*(mid_point.first) + a*(mid_point.second); 
  
    double temp = a; 
    a = -b; 
    b = temp; 
} 
  
// Returns the intersection point of two lines 
pdd lineLineIntersection(double a1, double b1, double c1, 
                         double a2, double b2, double c2) 
{ 
    double determinant = a1*b2 - a2*b1; 
    if (determinant == 0) 
    { 
        // The lines are parallel. This is simplified 
        // by returning a pair of FLT_MAX 
        return make_pair(FLT_MAX, FLT_MAX); 
    } 
  
    else
    { 
        double x = (b2*c1 - b1*c2)/determinant; 
        double y = (a1*c2 - a2*c1)/determinant; 
        return make_pair(x, y); 
    } 
} 
  
pdd findCircumCenter(pdd P, pdd Q, pdd R,pdd S) 
{ 
    // Line PQ is represented as ax + by = c 
    double a, b, c; 
    lineFromPoints(P, Q, a, b, c); 
  
    // Line QR is represented as ex + fy = g 
    double e, f, g; 
    lineFromPoints(R, S, e, f, g); 
  
    // Converting lines PQ and QR to perpendicular 
    // vbisectors. After this, L = ax + by = c 
    // M = ex + fy = g 
    perpendicularBisectorFromLine(P, Q, a, b, c); 
    perpendicularBisectorFromLine(R, S, e, f, g); 
  
    // The point of intersection of L and M gives 
    // the circumcenter 
    pdd circumcenter = 
           lineLineIntersection(a, b, c, e, f, g); 
  
    
    return circumcenter;
} 

double dis(double x1,double x2,double y1,double y2){
    return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
ll power(ll x, ll y) 
{ 
    ll res = 1;      // Initialize result 
  
    x = x % mod;  // Update x if it is more than or 
                // equal to p 
  
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % mod; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % mod; 
    } 
    return res; 
} 
ll modInverse(ll n) 
{ 
    return power(n, mod-2); 
} 

vector<ll> T;
ll gcd(ll a, ll b) {
    if(b == 0) 
        return a;
    return gcd(b, a%b);
}

ll gcd_vector(vector<ll>& a, ll b) {
    ll ma = 1;
    for(int i=0; i<T.size(); i++)
        ma = ma*T[i]%b;
    return gcd(b, ma);
}
int main()
{   ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int n;
    cin>>n;
    int i;
    ll lcma=1;
    ll a[n],b[n];
    ll sum=0;
    ll answer=1;
    rep(i,0,n){
        
        cin>>a[i];
        ll factor = a[i]/gcd_vector(T, a[i]); 
        T.push_back(factor);
        answer = (answer*factor)%mod;
    }
    
    rep(i,0,n){
        b[i]=(answer*modInverse(a[i]))%mod;
        sum=(sum+b[i])%mod;
    }
    cout<<sum;


    return 0;
             
    
}

Measured memory_bytes: 640