import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int modd = 1000000007; static int[] solve(int[] A) { long total = 0; // Return the length of the longest possible sequence of moves modulo 10^9+7. List numbers = new ArrayList<>(); List temp = new ArrayList<>(); List partial = new ArrayList<>(); for(int idx=0;idx