You are given an array of N integers. Your task is to find the number of ways of selecting non-empty subsequences of the array such that the absolute difference between any two adjacent elements (if they exist ) of the selected subsequence is not greater than K.
Since, the number of ways can be very large, output it modulo 1000000007.
Note: A subsequence of an array is an ordered subset of the array's elements having the same sequential ordering as the original array.
INPUT FORMAT
OUTPUT FORMAT
CONSTRAINTS