Given are N positive integers A_1,...,A_N.

Consider positive integers B_1, ..., B_N that satisfy the following condition.

Condition: For any i, j such that 1 \leq i < j \leq N, A_i B_i = A_j B_j holds.

Find the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.

Since the answer can be enormous, print the sum modulo (10^9 +7).

Constraints

* 1 \leq N \leq 10^4
* 1 \leq A_i \leq 10^6
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N
A_1 ... A_N


Output

Print the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).

Examples

Input

3
2 3 4


Output

13


Input

5
12 12 12 12 12


Output

5


Input

3
1000000 999999 999998


Output

996989508
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  int64_t Q=1000000007;
  cin>>N;
  vector<int> q(1000000);
  int64_t H=0;
  for(int i=0;i<N;i++){
    int64_t A;
    cin>>A;
    int64_t M=Q-2; //ここから
       int64_t a=1,b=0,c=1;
       while(M>0){
         a*=2;
         if(M%a!=0){
           M-=a/2;
           int64_t d=A;
           for(int j=0;j<b;j++){
            d=d*d;
             d=d%Q;
          }
           c=c*d;
          c=c%Q;
         }
        b++;
      } //ここまで
    H+=c;
    H%=Q;
    for(int64_t j=2;j<1000;j++){
      if(A%j==0){
        int d=0;
        while(A%j==0){
          d++;
          A/=j;
        }
        q.at(j)=max(q.at(j),d);
      }
    }
    if(q.at(A)==0){
      q.at(A)++;
    }
  }
  for(int i=0;i<1000000;i++){
    for(int j=0;j<q.at(i);j++){
      H*=i;
      H%=Q;
    }
  }
  cout<<H<<endl;
}