main=do
 n<-readLn;a<-map read.words<$>getLine
 print(f n a (g n a 1) 0)
  where g 0 _ l = l
        g n (k:a) l = g (n-1) a (lcm k l)
        f 0 _ _ i = i
        f n (k:a) l i = f (n-1) a l (mod(i+(quot l k))1000000007)