#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define A first
#define B second
#define mod 1000000007

ll inv[1000006];

vector<ll> arr;
void primeFactorization(ll num, unordered_map<ll, ll>& count)
{
    unordered_map<ll, ll> temp;
    while(num % 2 == 0) {
        num /= 2;
        temp[2]++;
    }
    for (int i = 3; i * i < num; ++i) {
        while(num % i == 0) {
            num /= i;
            temp[i]++;
        }
    }
    if(num > 2)
        temp[num]++;
    for (auto it : temp) {
        if(count[it.first] < it.second)
            count[it.first] = it.second;
    }
}
ll fp(ll base, ll exp)
{
    if (exp == 0)
        return 1;
    ll ans = fp(base, exp / 2);
    ans = (ans * ans) % mod;
    if (exp % 2 != 0)
        ans = (ans * (base % mod)) % mod;
    return ans;
}


void calcFacAndInv(ll n)
{
    for (ll i = 0; i < n; i++)
    {
        inv[i] = fp(arr[i], mod - 2);
    }
}
int main() {
    unordered_map<ll, ll> count;
    ll num;
    cin>>num;
    arr.resize(num);
    for (int i = 0; i < num; ++i) {
        cin>>arr[i];
        primeFactorization(arr[i], count);
    }

    calcFacAndInv(num );
    ll sum = 1;
    for(auto it : count)
    {
        sum = (sum * fp(it.first, it.second)) % mod;
    }
    ll result = 0;
    for (int i = 0; i < num; ++i) {
        result = (result + ((sum * inv[i]) % mod)) % mod;
    }
    cout<<result;
}