#include<bits/stdc++.h>
using namespace std;
#define int             long long int
#define pb              push_back
#define se              second
#define mp              make_pair
#define fi              first
#define del(a,vec)      vec.erase(std::remove(vec.begin(), vec.end(), a), vec.end());
#define search(f,l,v)   binary_search(f,l,v)
#define iter(a,b)       vector<int>::iterator a,b
#define lower(v,num)    lower_bound (v.begin(), v.end(), num);
#define upper(v,num)    upper_bound (v.begin(), v.end(), num); 
#define removecopy(a)   unique(a.begin(), a.end()); 
#define vi              vector<int> 
#define pi              pair<int,int>    
#define vpi             vector<pi>      
#define mlbb            ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)    
int mod =1000000007;
namespace Rahul{
    bool isPrime(int n) 
    {if (n <= 1)  return false; if (n <= 3)  return true; 
    if (n%2 == 0 || n%3 == 0) return false; 
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
    return true; }
    int pow (int x, int n,int mod) {//calculate x^n
    if (n == 0) return 1;

    int res = pow (x, n / 2,mod);

    res = (res * res) % mod;
    if (n % 2) res = (res * x ) % mod;

    return res;
    }
    int _gcd(int a,int b)
    {
        if(a==0)
            return b;
        else    
            return _gcd(b%a,a);
    }
    //s.erase(s.find(2)) where s={1,2,3,3,2}; 
};
using namespace Rahul;

int calcInverse(int a, int n)
{
    int t = 0, newt = 1;
    int r = n, newr = a;  
    while (newr != 0) {
        auto quotient = r /newr;
        tie(t, newt) = make_tuple(newt, t- quotient * newt);
        tie(r, newr) = make_tuple(newr, r - quotient * newr);
    }
    if (r > 1)
        throw runtime_error("a is not invertible");
    if (t < 0)
        t += n;
        
    t=t%n;    
    return t;
}
#define F first 
#define S second 
#define MAX 10000003 
using namespace std; 
  
typedef long long ll; 
// const int mod = 1000000007; 
  
int prime[MAX]; 
unordered_map<int, int> max_map; 
  
// Function to return a^n 
int power(int a, int n) 
{ 
    if (n == 0) 
        return 1; 
    int p = power(a, n / 2) % mod; 
    p = (p * p) % mod; 
    if (n & 1) 
        p = (p * a) % mod; 
    return p; 
} 
  
// Function to find the smallest prime factors 
// of numbers upto MAX
#define ll int
void sieve() 
{ 
    prime[0] = prime[1] = 1; 
    for (int i = 2; i < MAX; i++) { 
        if (prime[i] == 0) { 
            for (int j = i * 2; j < MAX; j += i) { 
                if (prime[j] == 0) { 
                    prime[j] = i; 
                } 
            } 
            prime[i] = i; 
        } 
    } 
} 
  
// Function to return the LCM modulo M 
ll lcmModuloM(const int* ar, int n) 
{ 
  
    for (int i = 0; i < n; i++) { 
        int num = ar[i]; 
        unordered_map<int, int> temp; 
  
        while (num > 1) { 
  
            int factor = prime[num]; 
  
            temp[factor]++; 
  
          
            num /= factor; 
        } 
  
        for (auto it : temp) { 
  
           
            max_map[it.first] = max(max_map[it.first], it.second); 
        } 
    } 
  
    ll ans = 1; 
  
    for (auto it : max_map) { 
  
        // LCM is product of primes to their highest powers modulo M 
        ans = (ans * power(it.F, it.S)) % mod; 
    } 
  
    return ans; 
} 
int32_t main()
{
        
    mlbb;
    sieve(); 

    int n;
    cin>>n;
    int a[n+1];
    // int num=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        
        
    }
    
    // num =a[0];
    // for(int i=1;i<n;i++){
        
    //     int val = (num*a[i])%mod;
    //     int val1 = _gcd(num,a[i]);
        
    //     int val2 = calcInverse(val1,mod);
        
    //     num = ((val)*(val2))%mod;
    //     // num = num % mod;
    // }
    
    int num = lcmModuloM(a,n);
    // cout<<num<<endl;
    int sum=0;
    int mod = 1e9 + 7;
    for(int i=0;i<n;i++){
        int val = a[i];
        
        sum = (sum +  num*calcInverse(val,mod))%mod;
        
        // sum +=(num/a[i])%mod;
        // sum%=mod;
    }
    // sum = sum%mod;
    
    cout<<sum<<endl;
    
    
}


Measured memory_bytes: 78848