program ABC152E
    implicit none
    integer(16)::N
    integer(16),allocatable,dimension(:)::A
    integer(16)::SK
    integer(16)::ANS=0
    integer(16)::mo=10**9+7
    integer(16)::i
    read*,N
    allocate(A(N))
    read*,A
    SK=A(1)
    do i=2,N
        SK=SK*A(i)/gcd(SK,A(i))
    end do
    ANS=0
    do i=1,N
        ANS=mod(ANS+SK/A(i),mo)
    end do
    print"(i0)",ANS
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