You are given an array of positive integers a1, a2, ..., an × T of length n × T. We know that for any i > n it is true that ai = ai - n. Find the length of the longest non-decreasing sequence of the given array.

Input

The first line contains two space-separated integers: n, T (1 ≤ n ≤ 100, 1 ≤ T ≤ 107). The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 300).

Output

Print a single number — the length of a sought sequence.

Examples

Input

4 3
3 1 4 2


Output

5

Note

The array given in the sample looks like that: 3, 1, 4, 2, 3, 1, 4, 2, 3, 1, 4, 2. The elements in bold form the largest non-decreasing subsequence. 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class OnceAgain {

	/**
	 * @param args
	 * @throws IOException 
	 * @throws NumberFormatException 
	 */
	public static void main(String[] args) throws NumberFormatException, IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int t = Integer.parseInt(input[1]);

        input = br.readLine().split(" ");
        int [] array = new int[n];
        for (int i = 0; i < array.length; i++) {
			array[i] = Integer.parseInt(input[i]);
		}
        
        int [][] matrix = new int[n + 1][n];
        
        for (int level = 0; level <= n; level++) {
        	for (int i = 0; i < n; i++) {
    			int max = 0;
    			for (int j = i - 1; j >= 0; j--) {
    				if (array[j] <= array[i] && matrix[level][j] > max) {
    					max = matrix[level][j];
    				}
    			}
    			
    			if (level > 0) {
    				for (int j = 0; j < n; j++) {
    					if (array[j] <= array[i] && matrix[level - 1][j] > max) {
    						max = matrix[level - 1][j];
    					}
    				}
    			}
    			matrix[level][i] = max + 1;
    		}
		}
        
        int maxLevel = t > n ? n : t;
        maxLevel--;
        int maxIndex = 0;
    	int max = 0;
		for (int i = 0; i < n; i++) {
			if (matrix[maxLevel][i] > max) {
				max = matrix[maxLevel][i];
				maxIndex = i;
			}
		}
		
        if (t > n) {
        	int rest = t - n;
        	max += rest * (matrix[n][maxIndex] - matrix[n - 1][maxIndex]);
		}
        
        System.out.println(max);
	}

}
