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.util.Scanner;

/**
 * Created by ckboss on 15-10-5.
 */
public class CF583D {

    final long INF=1<<62;

    class Matrix {
        Matrix(int _nx,int _ny) {
            nx=_nx; ny=_ny;
            m = new long[nx+1][ny+1];
        }
        public int nx,ny;
        public long[][] m;

        Matrix Add(Matrix mt) {

            Matrix ret = new Matrix(nx,ny);

            for(int i=1;i<=nx;i++) {
                for(int j=1;j<=ny;j++) {
                    ret.m[i][j]=-INF;
                    for(int k=1;k<=nx;k++) {
                        ret.m[i][j]=Math.max(ret.m[i][j],m[i][k]+mt.m[k][j]);
                    }
                }
            }

            return ret;
        }

        void Showit() {
            System.out.printf("nx: %d ny: %d\n",nx,ny);
            for(int i=1;i<=nx;i++) {
                for(int j=1;j<=ny;j++) {
                    System.out.printf("%d%c",m[i][j],(j==ny)?'\n':' ');
                }
            }
        }
    }

    Matrix QuickAdd(Matrix m ,int t) {

        Matrix ret = new Matrix(n,n);

        while(t!=0) {
            if(t%2==1) {
                ret=ret.Add(m);
            }
            m=m.Add(m);
            t/=2;
        }

        return ret;
    }

    int n,T;
    int[] a;

    CF583D() {

        Scanner in = new Scanner(System.in);

        n=in.nextInt();
        T=in.nextInt();
        a=new int[n+10];

        for(int i=1;i<=n;i++) {
            a[i]=in.nextInt();
        }

        /// get matrix
        Matrix M = new Matrix(n,n);

        for(int i=1;i<=n;i++) {
            for(int j=1;j<=n;j++) {
                if(a[j]<a[i])  {
                    M.m[i][j]=-INF;
                    continue;
                }
                M.m[i][j]=1;
                for(int k=1;k<j;k++) {
                   if(a[j]>=a[k]) {
                        M.m[i][j]=Math.max(M.m[i][j],M.m[i][k]+1);
                   }
                }
            }
        }

        Matrix mm = QuickAdd(M,T);

        long ans=0;
        for(int i=1;i<=n;i++) {
            for(int j=1;j<=n;j++) {
                ans=Math.max(ans,mm.m[i][j]);
            }
        }

        System.out.println(ans);
    }

    public static void main(String[] args) {
        new CF583D();
    }
}
