CodeTiger found an array of integers while walking around the LHS Lincoln field. Unfortunately, he erased some of the values with his paws. He only knows that all values were between \(1\) and \(M\) and that no adjacent values were the same. Your job is to find the number of possible original arrays. As that number can be very large, find the answer modulo \(10^9 + 7\).