using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static string InputPattern = "InputX";
static List<string> GetInputList()
{
var WillReturn = new List<string>();
if (InputPattern == "Input1") {
WillReturn.Add("3");
WillReturn.Add("2 3 4");
//13
}
else if (InputPattern == "Input2") {
WillReturn.Add("5");
WillReturn.Add("12 12 12 12 12");
//5
}
else if (InputPattern == "Input3") {
WillReturn.Add("3");
WillReturn.Add("1000000 999999 999998");
//996989508
}
else {
string wkStr;
while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
}
return WillReturn;
}
const long Hou = 1000000007;
static void Main()
{
List<string> InputList = GetInputList();
long[] AArr = InputList[1].Split(' ').Select(pX => long.Parse(pX)).ToArray();
var EntireSoinsuuDict = new Dictionary<long, long>();
foreach (long EachA in AArr) {
Dictionary<long, long> CurrSoinsuuDict = DeriveSoinsuuDict(EachA);
foreach (var EachPair in CurrSoinsuuDict) {
if (EntireSoinsuuDict.ContainsKey(EachPair.Key) == false) {
EntireSoinsuuDict[EachPair.Key] = EachPair.Value;
}
else {
long MaxCnt = EntireSoinsuuDict[EachPair.Key];
MaxCnt = Math.Max(MaxCnt, EachPair.Value);
EntireSoinsuuDict[EachPair.Key] = MaxCnt;
}
}
}
long LCM = 1;
foreach (var EachPair in EntireSoinsuuDict) {
long CurrVal = DeriveBekijyou(EachPair.Key, EachPair.Value, Hou);
LCM *= CurrVal;
LCM %= Hou;
}
long Answer = 0;
foreach (long EachA in AArr) {
Answer += LCM * DeriveGyakugen(EachA);
Answer %= Hou;
}
Console.WriteLine(Answer);
}
// 素因数分解し、指数[素数]なDictを返す
static Dictionary<long, long> DeriveSoinsuuDict(long pTarget)
{
var WillReturn = new Dictionary<long, long>();
long CurrVal = pTarget;
// ルートより大きい数を、素因素に持つとしても、1つだけのため
// ルートまで試し割りを行い、素因数が残っていたら、追加する
for (long I = 2; I * I <= pTarget; I++) {
if (CurrVal % I > 0) continue;
WillReturn[I] = 0;
while (CurrVal % I == 0) {
WillReturn[I]++;
CurrVal /= I;
}
if (CurrVal == 1) break;
}
// 素因数が残っている場合
if (CurrVal > 1) {
WillReturn[CurrVal] = 1;
}
return WillReturn;
}
// 引数の逆元を求める
static long DeriveGyakugen(long pLong)
{
return DeriveBekijyou(pLong, Hou - 2, Hou);
}
// 繰り返し2乗法で、(NのP乗) Mod Mを求める
static long DeriveBekijyou(long pN, long pP, long pM)
{
long CurrJyousuu = pN % pM;
long CurrShisuu = 1;
long WillReturn = 1;
while (true) {
// 対象ビットが立っている場合
if ((pP & CurrShisuu) > 0) {
WillReturn = (WillReturn * CurrJyousuu) % pM;
}
CurrShisuu *= 2;
if (CurrShisuu > pP) return WillReturn;
CurrJyousuu = (CurrJyousuu * CurrJyousuu) % pM;
}
}
}