
You are given a 0-indexed integer array nums representing the strength of some heroes. The power of a group of heroes is defined as follows:
Let i _0 , i _1 , ... , i _k be the indices of the heroes in a group. Then, the power of this group is max(nums[i _0 ], nums[i _1 ], ... ,nums[i _k ]) ^2 * min(nums[i _0 ], nums[i _1 ], ... ,nums[i _k ]) .
Return the sum of the power of all non-empty groups of heroes possible. Since the sum could be very large, return it modulo 10 ^9 + 7 .
1 <= nums.length <= 10 ^51 <= nums[i] <= 10 ^9