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.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

/**
 * Created by sbabkin on 9/14/2015.
 */
public class SolverD {

    public static void main(String[] args) throws IOException {
        new SolverD().Run();
    }

    BufferedReader br;
    PrintWriter pw;
    StringTokenizer stok;

    private String nextToken() throws IOException {
        while (stok==null || !stok.hasMoreTokens()){
            stok = new StringTokenizer(br.readLine());
        }
        return stok.nextToken();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    int kolMax=0;

    void addElem(Map<Integer, Integer> map, int elem) {
        Integer val=map.get(elem);
        if (val==null) {
            val=0;
        }
        val++;
        kolMax=Math.max(kolMax, val);
        map.put(elem, val);
    }

    private void Run() throws IOException {
//        br=new BufferedReader(new FileReader("input.txt"));
//        pw=new PrintWriter("output.txt");
        br=new BufferedReader(new InputStreamReader(System.in));
        pw=new PrintWriter(new OutputStreamWriter(System.out));

        solve();
        pw.flush();
        pw.close();
    }

    int n;
    int t;
    int rep;
    int[] mas;
    double[] lenVal;
    int resRaise=0;

    private void solve() throws IOException {
        n=nextInt();
        t=nextInt();
        rep=Math.min(t, n);
        mas=new int[n*rep];
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();
        for (int i=0; i<n; i++) {
            int val=nextInt();
            addElem(map, val);
            for (int j=0; j<rep; j++) {
                mas[j*n+i]=val;
            }
        }
        lenVal=new double[n*rep+10];
        Arrays.fill(lenVal, Integer.MAX_VALUE);
        lenVal[0]=Integer.MIN_VALUE;
        for (int i=0; i<n*rep; i++) {
            int val=mas[i];
            int pos = -Arrays.binarySearch(lenVal, 0.5+val)-1;
            lenVal[pos]=Math.min(val, lenVal[pos]);
            resRaise=Math.max(resRaise, pos);
        }
        pw.println(resRaise+(t-rep)*kolMax);
    }

}
