program ABC152E
    implicit none
    integer(16)::N
    integer(16),allocatable,dimension(:)::A
    integer(16)::SK,NSK
    integer(16)::ANS=0,B=0
    integer(16)::mo=10**9+7
    integer(16)::i
    read*,N
    allocate(A(N))
    read*,A
    SK=A(1);B=1
    do i=2,N
        NSK=SK*A(i)/gcd(SK,A(i))
        B=mod(NSK/SK*B+NSK/A(i),mo)
        SK=NSK
    end do
    print"(i0)",B
contains
integer(16) recursive function gcd(a, b)result(res)
  integer(16), intent(in)::a, b
  res=merge(b, gcd(b, mod(a, b)),mod(a, b)==0)
end function
end program ABC152E