Given an array of integers **A** of size **N**.

Value of a subset of array **A** is defined as product of all prime numbers in that subset.

If subset does not have any prime number in it, value of such a subset is 1.

If subset have only one prime number in it, value of such a subset is the prime number itself.

Calculate and return Sum of values of all possible subsets of array **A**% (10^9 + 7).

**Input Format**

```
The first and only argument given is the integer array A.
```

**Output Format**

```
Calculate and return Sum of values of all possible subsets of array % (10^9+ 7).
```

**Constraints**

```
1 <= N <= 10^5
1 <= A[i] < 2^31
max(A[1], A[2] ,..., A[n]) - min(A[1], A[2] ,..., A[n]) <=10^6
```

**For Example**

```
Input 1:
A = [3, 7]
Output 1:
32
Explaination 1:
Value ( [] ) = 1
Value ( [3] ) = 3
value ( [7] ) = 7
value ( [3, 7] ) = 21
answer = (1 + 3 + 7 + 21) % 1000000007 = 32
Input 2:
A = [4, 7]
Output 2:
16
Explaination 2:
value ( [] ) = 1
value ( [4] ) = 1
value ( [7] ) = 7
value ( [4, 7] ) = 7
answer = (1 + 1 + 7 + 7) % 1000000007 = 16
```

NOTE:You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.

Sign Up

to access hints and editorial solutions for**FAMOUS PRODUCT**

to access hints and editorial solutions for

Loading...