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.lang.*;
import java.math.*;
import java.util.*;
import java.io.*;

public class Main {
    void solve() {
        int n=ni(),T=ni();
        int a[]=new int[2*n*n+1];
        int cnt[]=new int[301];
        for(int i=1;i<=n;i++){
            a[i]=ni();
            cnt[a[i]]++;
        }
        long start[]=new long[n*n+1];
        long end[]=new long[n*n+1];
        st=new long[4*301+1];
        if(T<=2*n){
            long ans=0;
            for(int i=n+1;i<=T*n;i++) a[i]=a[i-n];
            for(int i=1;i<=T*n;i++){

                long mx=query(1,1,a[i],1,300);
                update(1,1,300,a[i],mx+1);
                ans=Math.max(ans,mx+1);
            }
            pw.println(ans);
            return;
        }
        for(int i=n+1;i<=n*n;i++ )a[i]=a[i-n];
        for(int i=1;i<=n*n;i++){

            long mx=query(1,1,a[i],1,300);
            update(1,1,300,a[i],mx+1);
            end[i]=mx+1;
        }
        Arrays.fill(st,0);
        for(int i=n*n;i>=1;i--){

            long mx=query(1,a[i],300,1,300);
            update(1,1,300,a[i],mx+1);
            start[i]=mx+1;
        }
        long ans=0;
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                if(a[i]<=a[j]){
                   long cc=end[n*(n-1)+i]+(T-2*n)*1L*cnt[a[i]]+start[j];


                   ans=Math.max(ans,cc);
                 //  if(ans==7543) pw.println(i+" "+j);

                }
            }
        }
        pw.println(ans);

    }
    long st[];
    void update(int id,int l,int r,int x,long val){
        if(l==r){
            st[id]=val;
        }else {
            int mid=(l+r)>>1;
            if(x<=mid) update(2*id,l,mid,x,val);
            else update(2*id+1,mid+1,r,x,val);
            st[id]=Math.max(st[2*id],st[2*id+1]);
        }
    }
    long query(int id,int x,int y,int l,int r){
        if(x>y) return 0;
        if(r<x || l>y )return 0;
        if(x<=l && r<=y) return st[id];
        int mid=(l+r)>>1;
        return Math.max(query(2*id,x,y,l,mid),query(2*id+1,x,y,mid+1,r));
    }




    long M= (long)1e9+7;
    InputStream is;
    PrintWriter pw;
    String INPUT = "";
    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
        if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");

    }
    public static void main(String[] args) throws Exception { new Main().run(); }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    private void tr(Object... o) { if(INPUT.length() > 0)System.out.println(Arrays.deepToString(o)); }

}