
You are given an integer array nums and a positive integer k . Return the sum of the maximum and minimum elements of all subsequences of nums with at most k elements.
Since the answer may be very large, return it modulo 10 ^9 + 7 .
1 <= nums.length <= 10 ^50 <= nums[i] <= 10 ^91 <= k <= min(70, nums.length)